You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/25 13:37:54 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1680: [CALCITE-3621] Push down sort to DB, SQL of Sort rel contains explicit field name instead of * when sort is not top rel

danny0405 commented on a change in pull request #1680: [CALCITE-3621] Push down sort to DB, SQL of Sort rel contains explicit field name instead of * when sort is not top rel
URL: https://github.com/apache/calcite/pull/1680#discussion_r361313332
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
 ##########
 @@ -634,6 +634,13 @@ public Result visit(Sort e) {
     }
     Result x = visitChild(0, e.getInput());
     Builder builder = x.builder(e, Clause.ORDER_BY);
+    if (builder.select.getSelectList() == null) {
 
 Review comment:
   Just curious, shouldn't we generate `SELECT "t2"."full_name", "t2"."last_name0" AS "last_name"` instead of `select *` ?
   
   Why we need a decision `if (stack.getLast().r != e)` it looks weird.
   
   Also, the generated sql outputs one more column than the original, i think it is because we generate the sql using the RelRoot.rel directly. We better fix this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services