drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [2/7] drill git commit: DRILL-6299: Fixed a filter pushed down issue when a column doesn't have stats
Date Fri, 30 Mar 2018 14:41:15 GMT
DRILL-6299: Fixed a filter pushed down issue when a column doesn't have stats

close apache/drill#1192


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/ea643bfe
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/ea643bfe
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/ea643bfe

Branch: refs/heads/master
Commit: ea643bfebeff8991d4e43fa8762773076087d0df
Parents: bfc86f1
Author: Salim Achouche <sachouche2@gmail.com>
Authored: Wed Mar 28 12:08:25 2018 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Thu Mar 29 23:18:32 2018 -0700

----------------------------------------------------------------------
 .../drill/exec/expr/stat/ParquetIsPredicates.java  | 17 ++++++-----------
 .../exec/expr/stat/ParquetPredicatesHelper.java    |  9 +++++++++
 2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/ea643bfe/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
index c6f9b2f..a58ce7c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
@@ -62,7 +62,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 
@@ -87,8 +87,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null ||
-          exprStat.isEmpty()) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 
@@ -113,8 +112,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null ||
-          exprStat.isEmpty()) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 
@@ -140,8 +138,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null ||
-          exprStat.isEmpty()) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 
@@ -167,8 +164,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null ||
-          exprStat.isEmpty()) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 
@@ -193,8 +189,7 @@ public class ParquetIsPredicates {
     public boolean canDrop(RangeExprEvaluator evaluator) {
       Statistics exprStat = expr.accept(evaluator, null);
 
-      if (exprStat == null ||
-          exprStat.isEmpty()) {
+      if (!ParquetPredicatesHelper.hasStats(exprStat)) {
         return false;
       }
 

http://git-wip-us.apache.org/repos/asf/drill/blob/ea643bfe/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetPredicatesHelper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetPredicatesHelper.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetPredicatesHelper.java
index ac82d65..e43acd3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetPredicatesHelper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetPredicatesHelper.java
@@ -22,9 +22,18 @@ import org.apache.parquet.column.statistics.Statistics;
 /**
  * Parquet predicates class helper for filter pushdown.
  */
+@SuppressWarnings("rawtypes")
 public class ParquetPredicatesHelper {
 
   /**
+   * @param stat statistics object
+   * @return true if the input stat object has valid statistics; false otherwise
+   */
+  public static boolean hasStats(Statistics stat) {
+    return stat != null && !stat.isEmpty();
+  }
+
+  /**
    * Checks that column chunk's statistics has only nulls
    *
    * @param stat parquet column statistics


Mime
View raw message