length error with relational functions

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:abc!1 2 3 q)d2:cde!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:abc!(1 1;2 2;3 3) q)d4:cde!(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?

Works with my version

q).z.k
2010.08.10
q).z.K
2.7

X-Mailer: Apple Mail (2.936)

use d3~'d4 as work around.

Junan

On Oct 3, 10:35?pm, Aaron Davies <aaron.dav…> wrote:> the problem is that it’s trying to compare a pair to the empty list in ?> some slots, and = only works on things that match in count at all levels>> q))show(y k;z k)> 1 1 ? ? 2 2 ? ? 3 3 int$() int$()> int$() int$() 3 3 4 4 ? ? 5 5> q))1 1=`int$()> 'length>Thanks, Aaron. I thought the length error was predictable given thenway dictionaries work, but what threw me was the chunk of system-levelcode that seemed to be breaking.</aaron.dav…>