Run a query
/query resource lets you stream the output records of a
statement via a chunked transfer encoding. The response is streamed back
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.
- Run a
SELECTstatement and stream back the results.
- 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.
property-name] (string): The value of the property named by
property-name. Both the value and
property-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.
Example curl command¶
1 2 3 4 5
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7