[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556246#comment-16556246
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on issue #1372: DRILL-6589: Push transitive closure predicates 
past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#issuecomment-407886857
 
 
   @vdiravka I have addressed your comments. Please take a look.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556232#comment-16556232
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205250094
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetFilterPushdownWithTransitivePredicates.java
 ##
 @@ -269,5 +269,19 @@ public void testForWithStatementAndDynamicStar() throws 
Exception {
 final String[] expectedPlan = {"first.*numRowGroups=2", 
"second.*numRowGroups=1"};
 testPlanMatchingPatterns(query, expectedPlan);
   }
+
+  @Test
+  public void testForTransitiveFilterPushPastAgg() throws Exception {
+String query = String.format("SELECT t1.`year` FROM %s t1 WHERE t1.`month` 
= 7 and t1.`period` = 2 and t1.`month` IN " +
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556231#comment-16556231
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205250070
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
+
+@Override
+public RelNode createAggregate(RelNode input, boolean indicator, 
ImmutableBitSet groupSet,
+   ImmutableList groupSets, 
List aggCalls) {
+  try {
+return new DrillAggregateRel(input.getCluster(), input.getTraitSet(), 
input, indicator, groupSet, groupSets, aggCalls);
+  } catch (InvalidRelException ex) {
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556229#comment-16556229
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205249991
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterAggregateTransposeRule.java
 ##
 @@ -24,20 +24,29 @@
 import org.apache.calcite.rel.core.Filter;
 import org.apache.calcite.rel.core.RelFactories;
 import org.apache.calcite.rel.rules.FilterAggregateTransposeRule;
+import org.apache.calcite.tools.RelBuilderFactory;
 import org.apache.drill.exec.planner.DrillRelBuilder;
 
 public class DrillFilterAggregateTransposeRule extends 
FilterAggregateTransposeRule{
 
   // Since Calcite's default FilterAggregateTransposeRule would match Filter 
on top of Aggregate, it potentially will match Rels with mixed CONVENTION trait.
-  // Here override match method, such that the rule matchs with Rel in the 
same CONVENTION.
+  // Here override match method, such that the rule matches with Rel in the 
same CONVENTION.
 
   public static final FilterAggregateTransposeRule INSTANCE = new 
DrillFilterAggregateTransposeRule();
 
+  public static final FilterAggregateTransposeRule DRILL_LOGICAL_INSTANCE = 
new DrillFilterAggregateTransposeRule(
+  DrillRelBuilder.proto(DrillRelFactories.DRILL_LOGICAL_FILTER_FACTORY, 
DrillRelFactories.DRILL_LOGICAL_AGGREGATE_FACTORY),
+  Filter.class, Aggregate.class);
+
   private DrillFilterAggregateTransposeRule() {
 super(Filter.class, 
DrillRelBuilder.proto(Contexts.of(RelFactories.DEFAULT_FILTER_FACTORY)),
 Aggregate.class);
   }
 
+  private DrillFilterAggregateTransposeRule(RelBuilderFactory 
relBuilderFactory,
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16556230#comment-16556230
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205250018
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
 ##
 @@ -40,6 +41,9 @@
 public class DrillPushFilterPastProjectRule extends RelOptRule {
 
   public final static RelOptRule INSTANCE = new 
DrillPushFilterPastProjectRule(DrillRelFactories.LOGICAL_BUILDER);
+  public final static RelOptRule DRILL_LOGICAL_INSTANCE =
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1695#comment-1695
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205088769
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
 ##
 @@ -40,6 +41,9 @@
 public class DrillPushFilterPastProjectRule extends RelOptRule {
 
   public final static RelOptRule INSTANCE = new 
DrillPushFilterPastProjectRule(DrillRelFactories.LOGICAL_BUILDER);
+  public final static RelOptRule DRILL_LOGICAL_INSTANCE =
 
 Review comment:
   If we aren't going to use it, it is better to leave this class without 
changes.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1697#comment-1697
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205094324
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestParquetFilterPushdownWithTransitivePredicates.java
 ##
 @@ -269,5 +269,19 @@ public void testForWithStatementAndDynamicStar() throws 
Exception {
 final String[] expectedPlan = {"first.*numRowGroups=2", 
"second.*numRowGroups=1"};
 testPlanMatchingPatterns(query, expectedPlan);
   }
+
+  @Test
+  public void testForTransitiveFilterPushPastAgg() throws Exception {
+String query = String.format("SELECT t1.`year` FROM %s t1 WHERE t1.`month` 
= 7 and t1.`period` = 2 and t1.`month` IN " +
 
 Review comment:
   `and`, `and` - upper case


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1696#comment-1696
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205087321
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterAggregateTransposeRule.java
 ##
 @@ -24,20 +24,29 @@
 import org.apache.calcite.rel.core.Filter;
 import org.apache.calcite.rel.core.RelFactories;
 import org.apache.calcite.rel.rules.FilterAggregateTransposeRule;
+import org.apache.calcite.tools.RelBuilderFactory;
 import org.apache.drill.exec.planner.DrillRelBuilder;
 
 public class DrillFilterAggregateTransposeRule extends 
FilterAggregateTransposeRule{
 
   // Since Calcite's default FilterAggregateTransposeRule would match Filter 
on top of Aggregate, it potentially will match Rels with mixed CONVENTION trait.
-  // Here override match method, such that the rule matchs with Rel in the 
same CONVENTION.
+  // Here override match method, such that the rule matches with Rel in the 
same CONVENTION.
 
   public static final FilterAggregateTransposeRule INSTANCE = new 
DrillFilterAggregateTransposeRule();
 
+  public static final FilterAggregateTransposeRule DRILL_LOGICAL_INSTANCE = 
new DrillFilterAggregateTransposeRule(
+  DrillRelBuilder.proto(DrillRelFactories.DRILL_LOGICAL_FILTER_FACTORY, 
DrillRelFactories.DRILL_LOGICAL_AGGREGATE_FACTORY),
+  Filter.class, Aggregate.class);
+
   private DrillFilterAggregateTransposeRule() {
 super(Filter.class, 
DrillRelBuilder.proto(Contexts.of(RelFactories.DEFAULT_FILTER_FACTORY)),
 Aggregate.class);
   }
 
+  private DrillFilterAggregateTransposeRule(RelBuilderFactory 
relBuilderFactory,
 
 Review comment:
   Let's combine two constructors into one:
   `private DrillFilterAggregateTransposeRule(RelBuilderFactory 
relBuilderFactory) {`
   `super(Filter.class, relBuilderFactory, Aggregate.class);`
   `}`
   In result you can use this constructor for `INSTANCE` and 
`DRILL_LOGICAL_INSTANCE`, but with different `RelBuilderFactory`


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-25 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1698#comment-1698
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r205094066
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
+
+@Override
+public RelNode createAggregate(RelNode input, boolean indicator, 
ImmutableBitSet groupSet,
+   ImmutableList groupSets, 
List aggCalls) {
+  try {
+return new DrillAggregateRel(input.getCluster(), input.getTraitSet(), 
input, indicator, groupSet, groupSets, aggCalls);
+  } catch (InvalidRelException ex) {
 
 Review comment:
   I have checked that `InvalidRelException` in `DrillAggregateRel` and 
`DrillAggregateRelBase` constructors declarations is redundant, it can never be 
thrown. So I suppose it is safe to remove it there and also all `try-catch` 
blocks connected to it.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554957#comment-16554957
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204952967
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/RuleInstance.java
 ##
 @@ -140,4 +145,14 @@
 
   SubQueryRemoveRule SUB_QUERY_JOIN_REMOVE_RULE =
   new 
SubQueryRemoveRule.SubQueryJoinRemoveRule(DrillRelFactories.LOGICAL_BUILDER);
+
+  FilterAggregateTransposeRule DRILL_FILTER_AGGREGATE_TRANSPOSE_RULE =
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554958#comment-16554958
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on issue #1372: DRILL-6589: Push transitive closure predicates 
past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#issuecomment-407595809
 
 
   @vdiravka thanks for the review. I have addressed your review comments. 
Please take a look.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554955#comment-16554955
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204952905
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
 ##
 @@ -50,9 +54,12 @@
   }
 
   private DrillPushFilterPastProjectRule(RelBuilderFactory relBuilderFactory) {
-super(operand(LogicalFilter.class, operand(LogicalProject.class, any())), 
relBuilderFactory,null);
+super(operand(LogicalFilter.class, operand(LogicalProject.class, any())), 
relBuilderFactory, null);
   }
 
+  private DrillPushFilterPastProjectRule(RelBuilderFactory relBuilderFactory, 
boolean forDrill) {
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554953#comment-16554953
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204952377
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/RuleInstance.java
 ##
 @@ -140,4 +145,14 @@
 
   SubQueryRemoveRule SUB_QUERY_JOIN_REMOVE_RULE =
   new 
SubQueryRemoveRule.SubQueryJoinRemoveRule(DrillRelFactories.LOGICAL_BUILDER);
+
+  FilterAggregateTransposeRule DRILL_FILTER_AGGREGATE_TRANSPOSE_RULE =
+  new FilterAggregateTransposeRule(Filter.class,
+  DrillRelBuilder.proto(DrillRelFactories.DRILL_LOGICAL_FILTER_FACTORY,
+  DrillRelFactories.DRILL_LOGICAL_AGGREGATE_FACTORY), 
Aggregate.class);
+
+  FilterProjectTransposeRule DRILL_FILTER_PROJECT_TRANSPOSE_RULE =
 
 Review comment:
   Removed.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554945#comment-16554945
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204951832
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
+
+@Override
+public RelNode createAggregate(RelNode input, boolean indicator, 
ImmutableBitSet groupSet,
+   ImmutableList groupSets, 
List aggCalls) {
+  try {
+return new DrillAggregateRel(input.getCluster(), input.getTraitSet(), 
input, indicator, groupSet, groupSets, aggCalls);
+  } catch (InvalidRelException ex) {
 
 Review comment:
   Done.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554944#comment-16554944
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204951732
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554942#comment-16554942
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204951494
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
 ##
 @@ -732,6 +732,25 @@ public void testPushFilterInExprPastAgg() throws 
Exception {
 .build().run();
   }
 
+  @Test
+  public void testTransitiveFilterPushPastAgg() throws Exception {
 
 Review comment:
   Moved testcase. I decided to remove the push filter past project rule from 
TC. It was causing too many side-effects (plan patterns breaking etc.). 
Moreover, it may not be very useful from a cost perspective. We can 
re-introduce it if it were to be applied in a cost-based manner (via Volcano 
planner).


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-24 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554943#comment-16554943
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai commented on a change in pull request #1372: DRILL-6589: Push transitive 
closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r204951637
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -92,7 +97,7 @@ public RelNode createProject(RelNode child,
 
   /**
* Implementation of {@link RelFactories.FilterFactory} that
-   * returns a vanilla {@link LogicalFilter}.
+   * returns a vanilla LogicalFilter.
 
 Review comment:
   Done


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.15.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539922#comment-16539922
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201651660
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
 ##
 @@ -732,6 +732,25 @@ public void testPushFilterInExprPastAgg() throws 
Exception {
 .build().run();
   }
 
+  @Test
+  public void testTransitiveFilterPushPastAgg() throws Exception {
 
 Review comment:
   This test case covers applying of `FilterAggregateTransposeRule`. Could you 
please add the test case for applying `DrillPushFilterPastProjectRule` after TC 
stage?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539924#comment-16539924
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201651660
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
 ##
 @@ -732,6 +732,25 @@ public void testPushFilterInExprPastAgg() throws 
Exception {
 .build().run();
   }
 
+  @Test
+  public void testTransitiveFilterPushPastAgg() throws Exception {
 
 Review comment:
   This test case covers applying of `FilterAggregateTransposeRule`. Could you 
please add the test case for applying of `DrillPushFilterPastProjectRule` after 
TC stage?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539918#comment-16539918
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201642791
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
+
+@Override
+public RelNode createAggregate(RelNode input, boolean indicator, 
ImmutableBitSet groupSet,
+   ImmutableList groupSets, 
List aggCalls) {
+  try {
+return new DrillAggregateRel(input.getCluster(), input.getTraitSet(), 
input, indicator, groupSet, groupSets, aggCalls);
+  } catch (InvalidRelException ex) {
 
 Review comment:
   see `InvalidRelException` description. It should be logged at debug level.
   Is it safe to work further with null?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539914#comment-16539914
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201647971
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
 ##
 @@ -50,9 +54,12 @@
   }
 
   private DrillPushFilterPastProjectRule(RelBuilderFactory relBuilderFactory) {
-super(operand(LogicalFilter.class, operand(LogicalProject.class, any())), 
relBuilderFactory,null);
+super(operand(LogicalFilter.class, operand(LogicalProject.class, any())), 
relBuilderFactory, null);
   }
 
+  private DrillPushFilterPastProjectRule(RelBuilderFactory relBuilderFactory, 
boolean forDrill) {
 
 Review comment:
   Where forDrill is used? It is not necessary to create separate constructor 
with additional not used parameter for separate Instance.
   There is no need to use `LogicalFilter.class` and `LogicalProject.class` in 
original constructor. You can use `Filter.class` and `Project.class` instead.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539916#comment-16539916
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201648880
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/RuleInstance.java
 ##
 @@ -140,4 +145,14 @@
 
   SubQueryRemoveRule SUB_QUERY_JOIN_REMOVE_RULE =
   new 
SubQueryRemoveRule.SubQueryJoinRemoveRule(DrillRelFactories.LOGICAL_BUILDER);
+
+  FilterAggregateTransposeRule DRILL_FILTER_AGGREGATE_TRANSPOSE_RULE =
+  new FilterAggregateTransposeRule(Filter.class,
+  DrillRelBuilder.proto(DrillRelFactories.DRILL_LOGICAL_FILTER_FACTORY,
+  DrillRelFactories.DRILL_LOGICAL_AGGREGATE_FACTORY), 
Aggregate.class);
+
+  FilterProjectTransposeRule DRILL_FILTER_PROJECT_TRANSPOSE_RULE =
 
 Review comment:
   Why it is added and unused anywhere?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539912#comment-16539912
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201641542
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -92,7 +97,7 @@ public RelNode createProject(RelNode child,
 
   /**
* Implementation of {@link RelFactories.FilterFactory} that
-   * returns a vanilla {@link LogicalFilter}.
+   * returns a vanilla LogicalFilter.
 
 Review comment:
   You can add it to import. But looks like it is wrong statement, this returns 
`DrillFilterRel` not `LogicalFilter`. 
   The same for `LogicalProject` and `LogicalJoin`. Please change it.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539911#comment-16539911
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201634016
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
 ##
 @@ -732,6 +732,25 @@ public void testPushFilterInExprPastAgg() throws 
Exception {
 .build().run();
   }
 
+  @Test
+  public void testTransitiveFilterPushPastAgg() throws Exception {
 
 Review comment:
   I think `TestParquetFilterPushdownWithTransitivePredicates` fits for placing 
this unit test better. This class was created for cases with Transitive 
Inference and Filter Push Down.
   Please place this test there and lead it to the common design in that class. 


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539913#comment-16539913
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201651660
 
 

 ##
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
 ##
 @@ -732,6 +732,25 @@ public void testPushFilterInExprPastAgg() throws 
Exception {
 .build().run();
   }
 
+  @Test
+  public void testTransitiveFilterPushPastAgg() throws Exception {
 
 Review comment:
   This test case covers applying `FilterAggregateTransposeRule`. Could you 
please add the test case for applying `DrillPushFilterPastProjectRule` after TC 
stage?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539915#comment-16539915
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201650457
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/RuleInstance.java
 ##
 @@ -140,4 +145,14 @@
 
   SubQueryRemoveRule SUB_QUERY_JOIN_REMOVE_RULE =
   new 
SubQueryRemoveRule.SubQueryJoinRemoveRule(DrillRelFactories.LOGICAL_BUILDER);
+
+  FilterAggregateTransposeRule DRILL_FILTER_AGGREGATE_TRANSPOSE_RULE =
 
 Review comment:
   Could you add this Instance in the `DrillFilterAggregateTransposeRule` as 
`DRILL_INSTANCE`? 
   Do we want to match Filter and Aggregate with mixed `CONVENTION` `Trait` 
(see `DrillFilterAggregateTransposeRule#matches()`)?


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539917#comment-16539917
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

vdiravka commented on a change in pull request #1372: DRILL-6589: Push 
transitive closure predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372#discussion_r201642111
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRelFactories.java
 ##
 @@ -122,4 +127,16 @@ public RelNode createJoin(RelNode left, RelNode right,
 }
   }
 
+  private static class DrillAggregateFactoryImpl implements 
RelFactories.AggregateFactory {
 
 Review comment:
   please add JavaDoc similar to other factories javadocs.


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DRILL-6589) Push transitive closure generated predicates past aggregates/projects

2018-07-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/DRILL-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539325#comment-16539325
 ] 

ASF GitHub Bot commented on DRILL-6589:
---

gparai opened a new pull request #1372: DRILL-6589: Push transitive closure 
predicates past aggregates/projects
URL: https://github.com/apache/drill/pull/1372
 
 
   @amansinha100 / @vdiravka please review the PR. Thanks!


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:
us...@infra.apache.org


> Push transitive closure generated predicates past aggregates/projects
> -
>
> Key: DRILL-6589
> URL: https://issues.apache.org/jira/browse/DRILL-6589
> Project: Apache Drill
>  Issue Type: Bug
>Affects Versions: 1.13.0
>Reporter: Gautam Kumar Parai
>Assignee: Gautam Kumar Parai
>Priority: Major
> Fix For: 1.14.0
>
>
> Here is a sample query that may benefit from this optimization:
> SELECT * FROM T1 WHERE a1 = 5 AND a1 IN (SELECT a2 FROM T2); 
> Here the transitive predicate a2 = 5 would be pushed past the aggregate due 
> to this optimization.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)