twdsilva commented on a change in pull request #431: PHOENIX-5105
URL: https://github.com/apache/phoenix/pull/431#discussion_r249928972
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/compile/SubselectRewriter.java
 ##########
 @@ -70,12 +69,126 @@ public static boolean 
isPostFilterConvertible(SelectStatement statement) throws
         return statement.getLimit() == null && (!statement.isAggregate() || 
!statement.getGroupBy().isEmpty());        
     }
     
-    public static SelectStatement applyOrderBy(SelectStatement statement, 
List<OrderByNode> orderBy, String subqueryAlias,TableNode tableNode) throws 
SQLException {
-        if (orderBy == null)
-            return statement;
-        
-        return new SubselectRewriter(null, statement.getSelect(), 
subqueryAlias).applyOrderBy(statement, orderBy, tableNode);
-    }
+    /**
+     * <pre>
+     * only append orderByNodes and postFilters, the optimization is left to 
{@link #flatten(SelectStatement, SelectStatement)}.
+     * an example is rewrite
+     * SELECT  REVERSE(LOC_ID),"supplier_id",NAME FROM SUPPLIERTABLE  LIMIT 5
 
 Review comment:
   Is this sql query correct? It doesn't include ```WHERE $2.NAME != 'S1``` ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to