Hi all, I have a splayed table with the `s attribute set in one
column. After an upsert, the attribute disappeared. This did not
happen if I save it as a “flat” table instead. Sample code below. Is
this an expected behavior? How can I preserve attributes in splayed
tables?
q)d:{-1 “=== “,y,” ===”; show x; show meta x} / display function
q)t:(s#x:1 2;y:1.1 1.2); d[t;"t"] / table with
s attribute in x-
column
=== t ===
x y
1 1.1
2 1.2
c | t f a |
---|---|
x | i s |
y | f |
q)FT:`:test/ft set t / flat table | |
q)ST:`:test/st/ set t / splayed table | |
q)d[get FT;“flat t”] | |
=== flat t === | |
x y |
1 1.1
2 1.2
c | t f a |
---|---|
x | i s |
y | f |
q)d[get ST;“splayed t”] | |
=== splayed t === | |
x y |
1 1.1
2 1.2
c | t f a |
---|---|
x | i s |
y | f |
q)FT upsert 1+last t | |
`:test/ft | |
q)ST upsert 1+last t | |
`:test/st/ | |
q)d[get FT;“flat t (after upsert)”] / s attribute preserved | |
=== flat t (after upsert) === | |
x y |
1 1.1
2 1.2
3 2.2
c | t f a |
---|---|
x | i s |
y | f |
q)d[get ST;“splayed t (after upsert)”] / s attribute lost | |
=== splayed t (after upsert) === | |
x y |
1 1.1
2 1.2
3 2.2
c | t f a |
---|---|
x | i |
y | f |
Swee Heng