[
https://issues.apache.org/jira/browse/TRAFODION-2047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15398074#comment-15398074
]
ASF GitHub Bot commented on TRAFODION-2047:
-------------------------------------------
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.
> add SQL syntax support to INTERSECT
> -----------------------------------
>
> Key: TRAFODION-2047
> URL: https://issues.apache.org/jira/browse/TRAFODION-2047
> Project: Apache Trafodion
> Issue Type: New Feature
> Reporter: liu ming
> Assignee: liu ming
> Fix For: 2.1-incubating
>
>
> INTERSECT is a common SQL syntax.
> Trafodion should support it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)