stariy95 commented on code in PR #605: URL: https://github.com/apache/cayenne/pull/605#discussion_r1487338797
########## cayenne/src/main/java/org/apache/cayenne/access/translator/select/OrderingStage.java: ########## @@ -54,13 +60,15 @@ private void processOrdering(QualifierTranslator qualifierTranslator, Translator nodeBuilder = function("UPPER", nodeBuilder); } - // If query is DISTINCT then we need to add all ORDER BY clauses as result columns - if(!context.isDistinctSuppression()) { - // TODO: need to check duplicates? - // need UPPER() function here too, as some DB expect exactly the same expression in select and in ordering - ResultNodeDescriptor descriptor = context.addResultNode(nodeBuilder.build().deepCopy()); - if(exp instanceof ASTAggregateFunctionCall) { - descriptor.setAggregate(true); + // If query is DISTINCT or GROUPING then we need to add all missing ORDER BY clauses as result columns Review Comment: Maybe we could move this logic to the new stage too? Then we'll have here just a simple ordering processing, and a new stage will process all orderings that need to be added to the result set. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cayenne.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org