From 31f2cab4e829193752772572328ed7f2875e8924 Mon Sep 17 00:00:00 2001 From: "Michael G. Noll" Date: Mon, 30 Oct 2017 14:00:46 +0100 Subject: [PATCH 1/2] Add example for using `--exec` --- docs/examples.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/examples.md b/docs/examples.md index f97d684679bf..8547834e3442 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -14,6 +14,8 @@ - [Aggregating, windowing, and sessionization](#aggregating) - [Working with arrays and maps](#working-with-arrays-and-maps) - [Configuring KSQL](#configuring-ksql) +- [Running KSQL](#running-ksql) + ## Overview @@ -301,3 +303,20 @@ Common configuration properties that you might want to change from their default - [cache.max.bytes.buffering](https://kafka.apache.org/documentation/#streamsconfigs): The default value in KSQL is `10000000` (~ 10 MB); + + +## Running KSQL + +KSQL support various [modes of operation](concepts.md#modes-of-operation), including a standalone mode and a +client-server mode. + +Additionally, you can also instruct KSQL to execute a single statement from the command line. + +Example: + +```shell +$ ksql-cli local --exec "SELECT * FROM pageviews LIMIT 5;" +``` + +This command will run the given `SELECT` statement and show the results in the terminal. In this particular +case, the query will run until 5 records have been found, and then terminate. From e1b2b46c6ae25d9e5349a74b528de2e48ed4de57 Mon Sep 17 00:00:00 2001 From: "Michael G. Noll" Date: Mon, 30 Oct 2017 17:02:04 +0100 Subject: [PATCH 2/2] Addressed Joel's comments --- docs/examples.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/examples.md b/docs/examples.md index 8547834e3442..b4a566e31372 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -307,16 +307,14 @@ Common configuration properties that you might want to change from their default ## Running KSQL -KSQL support various [modes of operation](concepts.md#modes-of-operation), including a standalone mode and a +KSQL supports various [modes of operation](concepts.md#modes-of-operation), including a standalone mode and a client-server mode. Additionally, you can also instruct KSQL to execute a single statement from the command line. - -Example: +The following example command runs the given `SELECT` statement and show the results in the terminal. In this +particular case, the query will run until 5 records have been found, and then terminate. ```shell $ ksql-cli local --exec "SELECT * FROM pageviews LIMIT 5;" ``` -This command will run the given `SELECT` statement and show the results in the terminal. In this particular -case, the query will run until 5 records have been found, and then terminate.