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

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/compile/JoinCompiler.java
 ##########
 @@ -761,13 +761,15 @@ public Expression 
compilePostFilterExpression(StatementContext context) throws S
         }
 
         public SelectStatement getAsSubquery(List<OrderByNode> orderBy) throws 
SQLException {
-            if (isSubselect())
-                return SubselectRewriter.applyOrderBy(
+            if (isSubselect()) {
+                return SubselectRewriter.applyOrderByAndPostFilters(
                         SubselectRewriter.applyPostFilters(subselect, 
preFilters, tableNode.getAlias()),
                         orderBy,
                         tableNode.getAlias(),
-                        tableNode);
-
+                        postFilters);
+            }
+            //for table, postFilters is empty , because it can safely pushed 
down as preFilters.
 
 Review comment:
   Yes, the `postFilters` which are pushed down to `JoinCompiler.Table` could 
always be pushed down to subquery by wrapping as outer `whereParseNodes` , I 
would omit more useless code to make it more clear.
   By contrast, the `postFilters `of `JoinCompiler.JoinTable` should be 
filtered separately after the join is completed.

----------------------------------------------------------------
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