Repository navigation
feat(qwp): report the designated timestamp and omit BINARY values of query results - #83
Open
glasstiger wants to merge 2 commits into
Open
glasstiger wants to merge 2 commits into
glasstiger wants to merge 2 commits into
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two query options to
query()andqueryViews(), 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 asdesignatedTimestamp: the column's index in the schema of the first batch, or -1 when the result has none, as/execreports it intimestamp.omitBinaryValues: QuestDB leaves the bytes of BINARY values out, as/execdoes, which sends every BINARY value as[]. Each non-null BINARY value then arrives as an emptyUint8Array, and a null asnull; 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_ENDthen ends withdesignated_timestamp:i32, after the row count and the statistics block.decodeQwpEgressMessageWithQueryFlags()reads it, and rejects a value that cannot name a result column.EXEC_DONEandQUERY_ERRORcarry 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
errorPosition,statsandcountRows, both options need theQUERY_DETAILScapability, and the client drops them for an endpoint without that capability, on a failover replay too. Such an endpoint sends the BINARY values in full.QUERY_DETAILSyet. A server built frommasterbetween feat(qwp): add error positions, timings, row counts and paging to QWP queries questdb#8356 and feat(qwp): report designated timestamps and omit BINARY values in QWP query results questdb#8693 advertises it without sending the designated timestamp trailer, so the client and the server changes should ship together.Documentation is updated; most of the diff is the regenerated API reference.
Validation
typecheck,typecheck:test,typecheck:qwp-browser,typecheck:dist, ESLint, Prettier,test:dist,check:packagesand the Chromium browser tests (test:qwp-browser).