Trying to get the equivalent of `null`-s used in `between` in `cross_between`


#1

I am trying to get the equivalent of null-s used between in cross_between.

Using the example code in https://paradigm4.atlassian.net/wiki/display/SD/cross_between , I created the larger array for cross_between

iquery -aq "show(cbB)"
{i} schema
{0} 'cbB<attrB1:double> [i=0:3,4,0,j=0:3,4,0]'

iquery -aq "scan(cbB)"
{i,j} attrB1
{0,0} 1
{0,1} 2
{0,2} 3
{0,3} 4
{1,0} 5
{1,1} 6
{1,2} 7
{1,3} 8
{2,0} 9
{2,1} 10
{2,2} 11
{2,3} 12
{3,0} 13
{3,1} 14
{3,2} 15
{3,3} 16

Next, I create a different right array for the cross-between. My test is to use the null keywords to get all values along i axis

iquery -aq " create array rB <iLo:int64 null,jLo:Int64 null,iHi:int64 null,jHi:int64 null>[rBi=0:2,3,0]"

iquery -aq " build(rB, '[(null,0,null,1),(null,2,null,3)]',true)"
{rBi} iLo,jLo,iHi,jHi
{0} null,0,null,1
{1} null,2,null,3

iquery -aq "cross_between(cbB, build(rB, '[(null,0,null,1),(null,3,null,3)]',true))"
{i,j} attrB1
{0,0} 1
{0,1} 2
{0,3} 4

Thus not the result I desire.

But the following works:

imin=0
imax=3
iquery -aq "cross_between(cbB, build(rB, '[($imin,0,$imax,1),($imin,3,$imax,3)]',true))"
{i,j} attrB1
{0,0} 1
{0,1} 2
{0,3} 4
{1,0} 5
{1,1} 6
{1,3} 8
{2,0} 9
{2,1} 10
{2,3} 12
{3,0} 13
{3,1} 14
{3,3} 16

Any ideas @donghui, @apoliakov ?


#2

Figured out the problem.

cross_between does not support null values.

According to http://www.paradigm4.com/HTMLmanual/15.7/scidb_ug/crossBetweenOperator.html:

The region_array is a one-dimensional array with 2n attributes (each with datatype int64) and m non-empty cells with no null values.