cancel
Showing results for 
Search instead for 
Did you mean: 

mismatch

borota
New Contributor
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
2 REPLIES 2

charlie
New Contributor II
New Contributor II
ideally , and ,: would have the same behaviour.
In the meantime, one workaround -

q)partialJoin:{x,$[count c:cols[x]except cols y;cols[x]#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

charlie
New Contributor II
New Contributor II
or more simply
partialJoin:{:x,:y}