Skip to content

feat(qwp): report the designated timestamp and omit BINARY values of query results - #83

Open
glasstiger wants to merge 2 commits into
mainfrom
ia_designated_timestamp
Open

glasstiger wants to merge 2 commits into
mainfrom
ia_designated_timestamp

Conversation

@glasstiger

@glasstiger glasstiger commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds two query options to query() and queryViews(), the client side of questdb/questdb#8693, in the shared core, so both the Node.js and browser clients get them:

  • designatedTimestamp: QuestDB reports which column of the result is its designated timestamp, and the result's completion carries it as designatedTimestamp: the column's index in the schema of the first batch, or -1 when the result has none, as /exec reports it in timestamp.
  • omitBinaryValues: QuestDB leaves the bytes of BINARY values out, as /exec does, which sends every BINARY value as []. Each non-null BINARY value then arrives as an empty Uint8Array, and a null as null; the server neither copies nor sends the bytes.

The web console needs both: it highlights the designated timestamp of results it reads over QWP, and shows BINARY values as [] without downloading them (questdb/ui#637).

Protocol

  • QWP_QUERY_FLAG_DESIGNATED_TIMESTAMP (0x80) asks for the designated timestamp, and carries no request field of its own.
  • RESULT_END then ends with designated_timestamp:i32, after the row count and the statistics block. decodeQwpEgressMessageWithQueryFlags() reads it, and rejects a value that cannot name a result column.
  • EXEC_DONE and QUERY_ERROR carry no designated timestamp.
  • QWP_QUERY_FLAG_OMIT_BINARY_VALUES (0x100) adds no request field and no trailer. The BINARY column keeps its layout, so the result decoders are unchanged.

Compatibility

Documentation is updated; most of the diff is the regenerated API reference.

Validation

Add the designatedTimestamp query option. A server that advertises
QUERY_DETAILS then ends RESULT_END with designated_timestamp:i32: the
index of the result column that is the designated timestamp, in the
schema of the first RESULT_BATCH, or -1 when the result has none, as
/exec reports it in "timestamp". The result's completion carries it as
designatedTimestamp.

- QWP_QUERY_FLAG_DESIGNATED_TIMESTAMP (0x80) asks for the trailer, which
  follows the row count and the statistics block. It carries no request
  field of its own.
- decodeQwpEgressMessageWithQueryFlags() reads it, and rejects a value
  that cannot name a result column.
- Like errorPosition, stats and countRows, the session drops the option
  for an endpoint without QUERY_DETAILS, on replay too. Statements and
  errors carry no designated timestamp.

Regenerate the API reference: most generated-file changes are TypeDoc
source-link, line-number and reflection-ID refreshes.
Add the omitBinaryValues query option to query() and queryViews(). A
server that advertises QUERY_DETAILS then sends each non-null BINARY
value of the result empty, zero bytes long, and a null as null, in the
usual layout of the column. QuestDB's /exec never sends BINARY content
either: it writes every BINARY value as []. The server neither copies
nor sends the bytes, so a client that does not read them no longer
waits for them.

- QWP_QUERY_FLAG_OMIT_BINARY_VALUES (0x100) asks for it. It adds no
  request field and no trailer, and the result decoders need no change:
  an omitted value decodes as an empty Uint8Array, a null as null.
- Like errorPosition, stats, countRows and designatedTimestamp, the
  session drops the option for an endpoint without QUERY_DETAILS, on
  replay too. Such an endpoint sends the values in full.

Regenerate the API reference: most generated-file changes are TypeDoc
source-link, line-number and reflection-ID refreshes.
@glasstiger glasstiger changed the title feat(qwp): report the designated timestamp of query results feat(qwp): report the designated timestamp and omit BINARY values of query results Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request qwp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant