A query result looks good if I break keyed table apart into key-value pair and combine them together: key!value. But a straight select from it gives an error. I constructed that keyed table in a slightly weird manner:
q)show t:([n:1 2] m:(`a`b!3 4;`a`b!5 6));
n| m
-| --------
1| `a`b!3 4
2| `a`b!5 6
q)t[;`m]
n| a b
-| ---
1| 3 4
2| 5 6
q)select from (key t[;`m])!value t[;`m]
n| a b
-| ---
1| 3 4
2| 5 6
q)select from t[;`m]
'type
[0] select from t[;`m]
^
Where does this 'type error come from?
Doing an exact match on what we expect
t[;`m]to be shows that something is up. If we deconstruct and reconstruct we get them being equal.We can get clues from the internal byte representation using
-8!, which unfortunately is not well documented. It seems that the values are being represented as a general list (type 0h =>0x00) of dictionaries instead of a table (type 98h =>0x62).