Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/623#discussion_r72685632
--- Diff: core/sql/optimizer/BindRelExpr.cpp ---
@@ -717,7 +717,7 @@ static ItemExpr *intersectColumns(const RETDesc
&leftTable,
ItemExpr *leftExpr = leftTable.getValueId(i).getItemExpr();
ItemExpr *rightExpr = rightTable.getValueId(i).getItemExpr();
BiRelat *compare = new (bindWA->wHeap())
- BiRelat(ITM_EQUAL, leftExpr, rightExpr);
+ BiRelat(ITM_EQUAL, leftExpr, rightExpr, TRUE);
--- End diff --
My hope is that hash and merge join are carefully implemented to make this
type of equals predicate with the "special nulls" semantics work as an
equi-join predicate. If we hash/sort NULL values as regular values, and
preserve the "special nulls" semantics for the actual comparison that's done in
the hash/merge join, it might work just fine, and hopefully your example proves
that this is indeed how it's implemented. The easiest way to check this is
probably an EXPLAIN and a SHOWPLAN. If you want to send me this info for the
example you added to the regression test (the one that includes a NULL value),
I can take a look.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---