[
https://issues.apache.org/jira/browse/TRAFODION-2270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15616480#comment-15616480
]
ASF GitHub Bot commented on TRAFODION-2270:
-------------------------------------------
Github user sureshsubbiah commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/795#discussion_r85605485
--- Diff: core/sql/optimizer/OptPhysRelExpr.cpp ---
@@ -11814,10 +11814,23 @@ 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 (ValueId vid = extraOrderExpr().init();
extraOrderExpr().next(vid);
--- End diff --
At this point does extraOrderExpr contain (studentname, test_score) or just
(test_score). This statement uses the query in TEST002 that is part of this PR.
I thought it would contain only test_score, if yes, then how we skip adding the
arrangement requirement with GroupExpr?
Also, is there a check somewhere that if such a clause is used we will
always come though sort groupby and not hash groupby?
Do we also know that partial groupby rule and shortcut groupby rule will be
prevented from firing? I assume we cannot get everything to work with partial
groups or shortcut groupby.
> support ORDER BY clause in GROUP_CONCAT function
> ------------------------------------------------
>
> Key: TRAFODION-2270
> URL: https://issues.apache.org/jira/browse/TRAFODION-2270
> Project: Apache Trafodion
> Issue Type: Sub-task
> Reporter: liu ming
> Assignee: liu ming
>
> currently, GROUP_CONCAT() in Trafodion cannot recognize order by clause, need
> to support it.
> for example:
> SELECT student_name,
> GROUP_CONCAT(DISTINCT test_score
> ORDER BY test_score asc SEPARATOR ' ')
> FROM student
> GROUP BY student_name;
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)