Repository navigation
720-fixes-for-kdb-x - #721
Merged
Merged
Conversation
Closed
jonathonmcmurray
approved these changes
Dec 19, 2025
Merged
jaen15marcos
added a commit
that referenced
this pull request
Dec 4, 2026
* Make the data-access postback work - .checkinputs.checkpostback rejected every postback. Its two checks look for a sync key, which is not a valid parameter (checkparamnames rejects any request that has one), and signal .schema.errors[`asyncpostback;`errormessage], which errormessages.csv does not define, so the error message was empty. Before #721 the two lines were missing their semicolons and never ran; once they ran, no postback got through. The check now asks the gateway: .gw.call says whether the caller's request is synchronous, and a postback on a sync request is refused with the existing checkpostback message ("Postback key only allowed for async requests"). On a process that is not a gateway, .gw.call does not exist and the check passes. - The gateway posts back (postback;query;result), and the client calls postback[query;result], while the data-access checks only accept a postback that takes one argument (the docs show {0N!x}). So even before #721 a valid postback failed with 'rank on the client. The gateway now hands asyncexecjpt {[f;q;r] f r}[postback], which takes the query and the result and gives the user's function the result. Through the gateway, an async getdata with the postback {`pbres set count x} now sets pbres to the row count on the client, and a sync getdata with a postback is refused with "Postback key only allowed for async requests". * Initialise the data-access API at start-up when discovery is off; write three of its checks portably - .dataaccess.init runs on every new connection (.servers.connectcustom), and a process normally makes one at start-up, to discovery. Under a connection limit, such as KDB-X's free licence (16 connections), TorQ turns discovery off (#727), so a process with no other connection to make never got the data-access API, and most data-access tests failed there. With discovery off, init now also runs once at the end of start-up, and a failure there is only logged, as on a new connection. With discovery on nothing changes. - .checkinputs.checkeachparam iterates over the row indices of the parameter table rather than over the table itself, which not every q implementation can iterate. The result is the same. - .eqp.extractoptimisationkey sets optimisation from the request, or 1b, instead of filling one dictionary into another with ^. - readtableproperties writes its "all or blank" proctype list as ``all rather than `all` - the same two symbols - as some q implementations' functional selects return nothing when a literal symbol list ends with the null symbol. * Fix two data-access tests - dataaccess/gwquerytest: since #639 the RDB advertises its partition through .rdb.getpartition, which processes/rdb.q defines. The test's mock RDB does not load rdb.q and only set .rdb.rdbpartition, so .proc.getattributes failed, the gateway held no attributes for it, and every query routed to the RDB got "no info found for that table name and time range". The mock RDB now defines .rdb.getpartition as well. - dataaccess/queryorder loaded its HDB with \l hdb, which is $TORQHOME/hdb, not the test's own HDB with the attribute helpers. * Keep master's data-access forms and rename columns only when asked checkeachparam iterates over the config table again, and readtableproperties writes the symbol list as enlist`all` again. Both were rewritten for q engines that read them differently from kdb+. The current builds of those engines read master's forms as kdb+ does, so the rewrites are no longer needed. getdata renames its result's columns only where the query asks for a rename. Without one it called xcol with an empty dictionary, which kdb+ accepts and which gives 'type on some q engines, so every getdata call failed there.
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.
added missing ";" which caused assign error in checkinputs.q
updated .gw.setserverstate parameter name in gateway.q from keyword "use" to "usestate"