aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical
diff options
context:
space:
mode:
authorchunhui-shi <cshi@maprtech.com>2017-12-22 15:42:27 -0800
committerParth Chandra <parthc@apache.org>2018-01-11 17:22:58 -0800
commitef0fafea214e866556fa39c902685d48a56001e1 (patch)
tree3fd867eee64a331103a7f1ee617be730a69ea812 /exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical
parentdcaac1b37a2df5a52cdb2d86bf78926488fcca64 (diff)
DRILL-6054: don't try to split the filter when it is not AND
This closes #1078
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/FindPartitionConditions.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/FindPartitionConditions.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/FindPartitionConditions.java
index da900652f..87732c393 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/FindPartitionConditions.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/partition/FindPartitionConditions.java
@@ -195,8 +195,16 @@ public class FindPartitionConditions extends RexVisitorImpl<Void> {
* For all other operators we clear the children if one of the
* children is a no push.
*/
- assert currentOp.getOp().getKind() == SqlKind.AND;
- newFilter = currentOp.getChildren().get(0);
+ if (currentOp.getOp().getKind() == SqlKind.AND) {
+ newFilter = currentOp.getChildren().get(0);
+ for (OpState opState : opStack) {
+ if (opState.getOp().getKind() == SqlKind.NOT) {
+ //AND under NOT should not get pushed
+ newFilter = null;
+ }
+ }
+
+ }
} else {
newFilter = builder.makeCall(currentOp.getOp(), currentOp.getChildren());
}
@@ -228,13 +236,16 @@ public class FindPartitionConditions extends RexVisitorImpl<Void> {
return false;
}
+ protected boolean inputRefToPush(RexInputRef inputRef) {
+ return dirs.get(inputRef.getIndex());
+ }
+
public Void visitInputRef(RexInputRef inputRef) {
- if(dirs.get(inputRef.getIndex())){
+ if (inputRefToPush(inputRef)) {
pushStatusStack.add(PushDirFilter.PUSH);
addResult(inputRef);
referencedDirs.set(inputRef.getIndex());
-
- }else{
+ } else {
pushStatusStack.add(PushDirFilter.NO_PUSH);
}
return null;