Github user zellerh commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1581#discussion_r196475078
--- Diff: core/sql/optimizer/RelExpr.cpp ---
@@ -13341,6 +13341,36 @@ void GenericUpdate::pushdownCoveredExpr(const
ValueIdSet &outputExpr,
newExternalInputs,
predicatesOnParent,
&localExprs);
+
+ if (avoidHalloween() && child(0) &&
+ child(0)->getOperatorType() == REL_SCAN &&
+ child(0)->getGroupAttr())
+ {
+ ValueIdSet cur_output =
child(0)->getGroupAttr()->getCharacteristicOutputs();
+ if (cur_output.isEmpty())
+ {
+ ValueId exprId;
+ ValueId atLeastOne;
+
+ ValueIdSet output_source =
child(0)->getTableDescForExpr()->getColumnList();
+ for (exprId = output_source.init();
+ output_source.next(exprId);
+ output_source.advance(exprId))
+ {
+ atLeastOne = exprId;
+ if
(!(exprId.getItemExpr()->doesExprEvaluateToConstant(FALSE, TRUE)))
+ {
+
child(0)->getGroupAttr()->addCharacteristicOutputs(exprId);
+ break;
+ }
+ }
+ cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
--- End diff --
Same comment as above, on line 13349.
---