Github user zellerh commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/291#discussion_r51333756
--- Diff: core/sql/optimizer/BindRelExpr.cpp ---
@@ -10272,8 +10273,14 @@ RelExpr* Insert::xformUpsertToMerge(BindWA *bindWA)
((Join*)re)->doNotTransformToTSJ();
((Join*)re)->setTSJForMerge(TRUE);
((Join*)re)->setTSJForMergeWithInsert(TRUE);
+ ((Join*)re)->setTSJForMergeUpsert(TRUE);
((Join*)re)->setTSJForWrite(TRUE);
- if (bindWA->hasDynamicRowsetsInQuery())
+
+ // if Inputs of current insert are empty (i.e. we have no params/rowsets)
+ // then there will be no pull up of inputs during transform and the join
will
+ // not see the inputs of the mergeUpdate due to intermediate nodes. So
+ // add inputs directly to join and use elimination to remove extra inputs
+ if (NOT getGroupAttr()->getCharacteristicInputs().isEmpty())
--- End diff --
Thanks for the explanation!
---
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.
---