Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/795#discussion_r86907405 --- Diff: core/sql/optimizer/OptPhysRelExpr.cpp --- @@ -11814,10 +11814,22 @@ void SortGroupBy::addArrangementAndOrderRequirements( { // Shouldn't/Can't add a sort order type requirement // if we are in DP2 - if (rg.getStartRequirements()->executeInDP2()) - rg.addArrangement(groupExpr(),NO_SOT); - else - rg.addArrangement(groupExpr(),ESP_SOT); + + if( NOT extraOrderExpr().isEmpty()) + { + ValueIdList groupExprCpy(groupExpr()); + for (CollIndex i=0; i< extraOrderExpr().entries(); i++) --- End diff -- Instead of this for loop, I think you can just do a single statement: `groupExprCpy.insert(extraOrderExpr());`
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---