

pgyorok
Forum Replies Created
-
Can you check if the definition was actually successful and didn’t throw an error?
-
It depends on the arity of the function being modified. If it’s a unary function, it’s peach. If it’s a binary function, it’s each-prior.
Overloaded glyphs | Reference | kdb+ and q documentation – Kdb+ and q documentation (kx.com)
code.kx.com
Overloaded glyphs | Reference | kdb+ and q documentation - Kdb+ and q documentation
Many non-alphabetic keyboard characters are overloaded by q. This page tabulates their different forms.
-
The handle is an OS level file handle, not the port number. In fact it is possible to open multiple connections to the same process and naturally they get different handles.
Does the handle show up in .z.W before you try to close it?
Can you check the logs of the remote process to make sure it’s working fine?
-
like takes a string on the right. “IBM” is a string. “t” is not a string but a character – this is a quirk in the syntax. If you want to have a one-character string you have to use enlist, in this case enlist”t”.
-
pgyorok
MemberApril 3, 2024 at 3:35 pm in reply to: Keeping data querable while processes are taking downIt is a good idea to have multiple processes with a load balancer in front. That way if one or more processes dies the others can still serve incoming requests.
If you have multiple processes and you need to restart them, you could do it one by one such that there is always at least one process available.
-
It is an unfortunate coincidence that one of the columns in the table happens to be called “sym”. It could be called anything, but usually it is a symbol column that is used as some kind of key (e.g. instrument ID).
In a splayed table, symbol columns must be enumerated (see Splayed tables | Knowledge Base | kdb+ and q documentation – Kdb+ and q documentation (kx.com)). This is the reason for the sym file at the top level.
You could have multiple sym files in a DB, for example one per table, but all of them need to be in the DB root to work.
code.kx.com
Splayed tables | Knowledge Base | kdb+ and q documentation - Kdb+ and q documentation
Splaying a table stores each column as a separate file, rather than using a single file for the whole table
-
EDIT: sorry for the illegible code blocks, there seem to be serious issues with this forum software.
Can you make it more clear what you are trying to achieve?
“How to parse functional select” – this would be something like
q)parse"?[quote;();0b;time,sym,bid,ask!time,sym,bid,ask]" ? ,quote () 0b (!;,time,sym,bid,ask;,time,sym,bid,ask)
However this is no different from “how to parse any expression in q”, there is nothing special in the expression being parsed is a functional select.
If the question was “how to convert a functional select into a regular select” then your code is exactly doing that:
q)table:"quote" q)parse "select time, sym, bid, ask from ",table ? quote () 0b time,sym,bid,ask!time,sym,bid,ask
“How to get data from the functional select” is a different question. You might want to check Functional qSQL | Basics | kdb+ and q documentation – Kdb+ and q documentation (kx.com) which has plenty of examples. In this particular example you would simply write down the result of the parse expression in function call form:
?[$table;();0b;time,sym,bid,ask!time,sym,bid,ask]
Note that here we are casting the string to a symbol, but that’s only because that’s what conforms to your function’s signature. You might want to consider changing it such that it takes a symbol for the table name instead, in which case you wouldn’t need a cast:
?[table;();0b;time,sym,bid,ask!time,sym,bid,ask]