If set, enables partial results for aggregation queries.
optional[boolean]
stats
Millis interval to receive query stats. If not provided the stats information is not sent
optional[int]
The client should wait for incoming messages and stop when EOF is received. The server sends JSON-encoded messages, the payload structure is:
{"type": <Enumeration>,"data": <Dependent on the type field>}
Since there are multiple types of messages the server sends, the type attribute determines the data structure for the data payload. Below is the list of possible type values:
Value
Description
HEARTBEAT
To keep the connection alive, the server injects an empty message.
RECORD
The message represents a data record.
ERROR
The message contains information about an error that occurred.
STATS
The message contains information about the current execution.Only activated if the stats field in the request is present.
METADATA
The message contains a list of metadata fields each record message will contain. For example: offset, partition,timestamp, __keysize, __valueSize, valueSchemaId.
SCHEMA
Reserved.
PAGE_END
Reserved.
END
The message signals the end of the execution. The server will close the socket after this message is sent.
BADRECORD
The message contains information about the Kafka message which cannot be read. For example, if the topic expects Avro and the payload is not a valid Avro.
SENTINEL
The message contains information about the execution termination reason when query thresholds are reached.
Message types
Heartbeat
The data the attribute is null. The client should ignore these messages.
Returns the underlying Kafka message key value. Only applied when * projection is used. When a key projection is used (i.e. _key.MMSI), the value is returned as data.value.MMSI.
data.data
Will contain the output generated by the SQL projections. If * is used for the SQL projection, it will return the Kafka message value structure.
data.metadata
Returned when no aggregations are involved. It contains the Kafka message partition, offset, byte size information
data.rownum
Reserved optional long value.
Examples
For a topic which contains nested data for both key and value.