I’m getting a length error when applying relational functions to
dictionaries with disjoint domains and non-scalar ranges.
KDB+ 2.7 2010.08.05 Copyright (C) 1993-2010 Kx Systems
m32/ 2()core 4096MB andy slakt.local 10.0.1.3 PLAY 2010.11.03
First, the simple case:
q)d1:a
bc!1 2 3 q)d2:
cd
e!3 4 5
q)d1+d2
a| 1
b| 2
c| 6
d| 4
e| 5
q)d1=d2
a| 0
b| 0
c| 1
d| 0
e| 0
Where the domains don’t overlap, = evaluates to 0b, which seems
reasonable. However, with the same domains but slightly more
complicated ranges in the dictionaries, things go askew:
q)d3:a
bc!(1 1;2 2;3 3) q)d4:
cd
e!(3 3;4 4;5 5)
q)d3+d4
a| 1 1
b| 2 2
c| 6 6
d| 4 4
e| 5 5
q)d3=d4
k){k!y[k]x’z k:?(!y),!z}
'length
q))\
Is this desired behavior, or is it a bug?
Also, I’ve looked in q.k for the function shown in the error display,
but can’t find it. Is there somewhere else to look?