Run a query
The /query resource lets you stream the output records of a SELECT
statement via a chunked transfer encoding. The response is streamed back
until the LIMIT specified in the statement is reached, or the client
closes the connection. If no LIMIT is specified in the statement, then
the response is streamed until the client closes the connection.
POST /query¶
- Run a
SELECTstatement and stream back the results.
JSON Parameters:¶
- ksql (string): The SELECT statement to run.
- streamsProperties (map): Property overrides to run the statements with. Refer to the Config Reference for details on properties that you can set.
- streamsProperties[
property-name] (string): The value of the property named byproperty-name. Both the value andproperty-nameshould be strings.
Each response chunk is a JSON object with the following format:
Response JSON Object:
- row (object): A single row being returned. This will be null if an error is being returned.
- row.columns (array): The values contained in the row.
- row.columns[i] (?): The value contained in a single column for the row. The value type depends on the type of the column.
- finalMessage (string): If this field is non-null, it contains a final message from the server. No additional rows will be returned and the server will end the response.
- errorMessage (string): If this field is non-null, an error has been encountered while running the statement. No additional rows are returned and the server will end the response.
Examples¶
Example curl command¶
1 2 3 4 5 | |
Example request¶
1 2 3 4 5 6 7 8 9 10 | |
Example response¶
1 2 3 4 5 6 7 | |
Last update:
2021-02-09