I am having problems when I want to add column symbol or string to a splay table. I encounter a type error when trying to add data to the splay. Below is an example of the errors I am having.
For instance if I make a splay table as follows and upsert a small table into the splay it works
db_big: ([] id:`aa`bb; ti:1 2 ; p:1.1 1.2; str:("a&a";"b&b"))
db_big: .Q.en[`:c:/q/splay/] db_big
`:c:/q/splay/db_big/ set db_big
db_small: ([] id:`symbol$(); ti:`int$() ; p:`float$(); str:())
`db_small insert (`ff;6;1.6;"")
db_small: .Q.en[`:c:/q/splay/] db_small
`:c:/q/splay/db_big/ upsert db_small;
Adding new float column "p1" which is not a symbol works fine when upserting to splay
db_small: ([] id:`symbol$(); ti:`int$() ; p:`float$(); str:())
`db_small insert (`ff;6;1.6;"")
db_small: .Q.en[`:c:/q/splay/] db_small
`:c:/q/splay/db_big/ upsert db_small;
@[`:c:/q/splay/db_big; `p1; : ; (count db_big)#0n]
.[`:c:/q/splay/db_big/.d;(); , ; `p1]
db_small: ([] id:`symbol$(); ti:`int$() ; p:`float$();str:();p1:`float$())
`db_small insert (`ff;6;1.6;"";1.7)
db_small: .Q.en[`:c:/q/splay/] db_small
`:c:/q/splay/db_big/ upsert db_small;
However if I try to add a new columns id1:symbol and str1:string to the splay table the upsert fails (type error). Same error occurs if I only add one column (either symbol or string)
@[`:c:/q/splay/db_big; `id1; : ; (count db_big)#`]
.[`:c:/q/splay/db_big/.d;(); , ; `id1]
@[`:c:/q/splay/db_big; `str1; : ; (count db_big)#()]
.[`:c:/q/splay/db_big/.d;(); , ; `str1]
db_small: ([] id:`symbol$(); ti:`int$() ; p:`float$();str:();p1:`float$();id1:`symbol$();str1:())
`db_small insert (`ff;6;1.6;"";1.7;`gg;"")
db_small: .Q.en[`:c:/q/splay/] db_small
`:c:/q/splay/db_big/ upsert db_small;
I can see that I should in some way use .Q.en when adding a symbol or string column but I haven't found anything in the docs.
meta db_small
c t f a
0 id s
1 ti i
2 p f
3 str C
4 p1 f
5 id1 s
6 str1 C
meta db_big
c t f a
0 id s
1 ti i
2 p f
3 str C
4 p1 f
5 id1 s
6 str1
Can anyone help?
Many thanks
David