Search code examples
kdb

kdb: get column names of non-keyed table


Given a non-keyed table like t:([]c1:`a`b;c2:10 20), is cols t always equivalent to key flip t?

(Asking as I saw several key flip t's in a repo I'm working on)


Solution

  • Yes, see the bold part of cols below

    k){$[.Q.qp x:.Q.v x;.Q.pf,!+x;98h=@x;!+x;11h=@!x;!x;!+0!x]}