There are a bunch of tricks used in kdb+ to work with keyed/splayed/partitioned and simple tables. I see lots of .Q
functions which work as a facade for these varieties. One of them is cols
. Could you help me please with one of the cases - what the 11h=
case stands for?
cols
k){$[
.Q.qp x:.Q.v x; / If partitioned
.Q.pf,!+x; / add "partitioned field" to table cols
98h=@x; / If simple table
!+x; / just table cols (convert to dict of lists, get keys)
11h=@!x; / ?
!x;
!+0!x / (keys-dict)!(data-dict): remove keys, get table cols
]}
It's for dictionaries:
q)cols`a`b`c!1 2 3
`a`b`c
Where the type (@
) of the key (!
) is a list of symbols (11h
)