Hello,
I would like to kindly ask You to take a moment and explain to me how does this
BinaryEvalCtx handle NULL values in fields. From an error I got recently it
seems that when it reads NULL values and it has to compare them to non-NULL
values, it breaks.
The portion of code leading to error in is the same as in the original
NLJoinExec and other join algorithms, where TAJO needs to verify the join
condition and then project according to the output schema:
if (joinQual != null) {
joinQual.eval(qualCtx, inSchema, frameTuple);
if (joinQual.terminate(qualCtx).asBool()) {
Here the verification of the join condition fails if one operand is a NULL
value and the other is a number, in this case number 10.
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ********leftChild.next()
=(0=>10)
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ********rightChild.next()
=(0=>333.0, 1=>10)
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ******** a result matched
padded tuple =(0=>10, 1=>333.0)
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ********rightChild.next()
=(0=>555.0, 1=>10)
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ******** a result matched
padded tuple =(0=>10, 1=>555.0)
13/09/11 21:37:01 INFO physical.LeftOuter_NLJoinExec: ********rightChild.next()
=(0=>777.0, 1=>NULL)
13/09/11 21:37:01 ERROR worker.Task:
org.apache.tajo.datum.exception.InvalidOperationException
at org.apache.tajo.datum.Int4Datum.equalsTo(Int4Datum.java:122)
at org.apache.tajo.engine.eval.BinaryEval.terminate(BinaryEval.java:158)
at
org.apache.tajo.engine.planner.physical.LeftOuter_NLJoinExec.next(LeftOuter_NLJoinExec.java:157)
at
org.apache.tajo.engine.planner.physical.StoreTableExec.next(StoreTableExec.java:85)
at org.apache.tajo.worker.Task.run(Task.java:378)
at org.apache.tajo.worker.TaskRunner$2.run(TaskRunner.java:359)
at java.lang.Thread.run(Thread.java:662)
It seems that at this moment, it takes the NULL as being Int4Datum, instead of
NullDatum.
These classes exist beyond outer join nodes' scope but maybe they weren't
tested for NULL values before. Now, some of the outer join's processing relies
on these classes' correct behavior, that is why I'm trying to signal when I
find errors.
Thank You in advance for Your answer and for the understanding!
Yours sincerely,
Camelia