This works:
q)t:(a:a
b;b:0 1;c:“ab”)
q)show t,:(a:c
d;c:“cd”)
a b c
a 0 a
b 1 b
c c
d d
Why this, which semantically you’d think it’s exactly the same thing, doesn’t work?
q)t:(a:a
b;b:0 1;c:“ab”)
q)t:t,(a:c
d;c:“cd”)
'mismatch
This works:
q)t:(a:a
b;b:0 1;c:“ab”)
q)show t,:(a:c
d;c:“cd”)
a b c
a 0 a
b 1 b
c c
d d
Why this, which semantically you’d think it’s exactly the same thing, doesn’t work?
q)t:(a:a
b;b:0 1;c:“ab”)
q)t:t,(a:c
d;c:“cd”)
'mismatch
ideally , and ,: would have the same behaviour.
In the meantime, one workaround -
q)partialJoin:{x,$[count c:colsexcept cols y;cols#y,'count[y]#0#c#x;y]}
q)t:(a:a
b;b:0 1;c:“ab”);t1:(a:c
d;c:“cd”);(t,:t1)~partialJoin[t;t1]
1b
or more simply
partialJoin:{:x,:y}