In our example, the type of the thing column has been promoted to symbol; we can’t insert numbers into it.

When you want to store elements of different types in the same column, you have to prevent q from performing this type promotion by stuffing a sentinel row (i.e., a row of dummy values), whose value for the column in question is itself a list, into the table:

q)t: ([] thing: enlist “sentinel”)
q)meta t
c | t f a
—–| —–
thing| C

Don’t believe the hype. The meta function is trying to help out by actually inspecting the first value in the column when reporting the thing column’s type. However, the true type of the column is untyped, i.e., zero:

This work is licensed under a Creative Commons License.
The views and opinions expressed herein are those of the authors and do not necessarily reflect those of any other person or legal entity.
Kdb+ is the registered trademark of Kx Systems, Inc.