drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyfar...@apache.org
Subject [drill] 02/02: DRILL-6481: Rename ParquetXXXPredicates to ParquetXXXPredicate
Date Tue, 12 Jun 2018 03:39:45 GMT
This is an automated email from the ASF dual-hosted git repository.

timothyfarkas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git

commit ded643deeafbabe9363499960a135d33652bf567
Author: Vlad Rozov <vrozov@apache.org>
AuthorDate: Thu Jun 7 18:14:01 2018 -0700

    DRILL-6481: Rename ParquetXXXPredicates to ParquetXXXPredicate
    
    closes #1312
---
 ...redicates.java => ParquetBooleanPredicate.java} | 12 +++++-----
 ...icates.java => ParquetComparisonPredicate.java} | 28 +++++++++++-----------
 ...etIsPredicates.java => ParquetIsPredicate.java} | 20 ++++++++--------
 .../exec/store/parquet/ParquetFilterBuilder.java   | 14 +++++------
 4 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicates.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicate.java
similarity index 86%
rename from exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicates.java
rename to exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicate.java
index b062f87..fa5c467 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicates.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetBooleanPredicate.java
@@ -27,10 +27,10 @@ import java.util.List;
 /**
  * Boolean predicates for parquet filter pushdown.
  */
-public abstract class ParquetBooleanPredicates<C extends Comparable<C>> extends
BooleanOperator
+public abstract class ParquetBooleanPredicate<C extends Comparable<C>> extends
BooleanOperator
     implements ParquetFilterPredicate<C> {
 
-  private ParquetBooleanPredicates(String name, List<LogicalExpression> args, ExpressionPosition
pos) {
+  private ParquetBooleanPredicate(String name, List<LogicalExpression> args, ExpressionPosition
pos) {
     super(name, args, pos);
   }
 
@@ -45,7 +45,7 @@ public abstract class ParquetBooleanPredicates<C extends Comparable<C>>
extends
       List<LogicalExpression> args,
       ExpressionPosition pos
   ) {
-    return new ParquetBooleanPredicates<C>(name, args, pos) {
+    return new ParquetBooleanPredicate<C>(name, args, pos) {
       @Override
       public boolean canDrop(RangeExprEvaluator<C> evaluator) {
         // "and" : as long as one branch is OK to drop, we can drop it.
@@ -65,7 +65,7 @@ public abstract class ParquetBooleanPredicates<C extends Comparable<C>>
extends
       List<LogicalExpression> args,
       ExpressionPosition pos
   ) {
-    return new ParquetBooleanPredicates<C>(name, args, pos) {
+    return new ParquetBooleanPredicate<C>(name, args, pos) {
       @Override
       public boolean canDrop(RangeExprEvaluator<C> evaluator) {
         for (LogicalExpression child : this) {
@@ -87,9 +87,9 @@ public abstract class ParquetBooleanPredicates<C extends Comparable<C>>
extends
   ) {
     switch (function) {
       case "booleanOr":
-        return ParquetBooleanPredicates.<C>createOrPredicate(name, args, pos);
+        return ParquetBooleanPredicate.<C>createOrPredicate(name, args, pos);
       case "booleanAnd":
-        return ParquetBooleanPredicates.<C>createAndPredicate(name, args, pos);
+        return ParquetBooleanPredicate.<C>createAndPredicate(name, args, pos);
       default:
         logger.warn("Unknown Boolean '{}' predicate.", function);
         return null;
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicates.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicate.java
similarity index 86%
rename from exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicates.java
rename to exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicate.java
index 3cb8877..9e561ad 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicates.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetComparisonPredicate.java
@@ -34,13 +34,13 @@ import static org.apache.drill.exec.expr.stat.ParquetPredicatesHelper.isAllNulls
 /**
  * Comparison predicates for parquet filter pushdown.
  */
-public class ParquetComparisonPredicates<C extends Comparable<C>> extends LogicalExpressionBase
+public class ParquetComparisonPredicate<C extends Comparable<C>> extends LogicalExpressionBase
     implements ParquetFilterPredicate<C> {
   private final LogicalExpression left;
   private final LogicalExpression right;
   private final BiPredicate<Statistics<C>, Statistics<C>> predicate;
 
-  private ParquetComparisonPredicates(
+  private ParquetComparisonPredicate(
       LogicalExpression left,
       LogicalExpression right,
       BiPredicate<Statistics<C>, Statistics<C>> predicate
@@ -109,7 +109,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
       LogicalExpression left,
       LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when left's max < right's min, or right's max < left's min
       final C leftMin = leftStat.genericGetMin();
       final C rightMin = rightStat.genericGetMin();
@@ -129,7 +129,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
       LogicalExpression left,
       LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when left's max <= right's min.
       final C rightMin = rightStat.genericGetMin();
       return leftStat.genericGetMax().compareTo(rightMin) <= 0;
@@ -143,7 +143,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
       LogicalExpression left,
       LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when left's max < right's min.
       final C rightMin = rightStat.genericGetMin();
       return leftStat.genericGetMax().compareTo(rightMin) < 0;
@@ -157,7 +157,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
       LogicalExpression left,
       LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when right's max <= left's min.
       final C leftMin = leftStat.genericGetMin();
       return rightStat.genericGetMax().compareTo(leftMin) <= 0;
@@ -170,7 +170,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
   private static <C extends Comparable<C>> LogicalExpression createLEPredicate(
       LogicalExpression left, LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when right's max < left's min.
       final C leftMin = leftStat.genericGetMin();
       return rightStat.genericGetMax().compareTo(leftMin) < 0;
@@ -184,7 +184,7 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
       LogicalExpression left,
       LogicalExpression right
   ) {
-    return new ParquetComparisonPredicates<C>(left, right, (leftStat, rightStat) ->
{
+    return new ParquetComparisonPredicate<C>(left, right, (leftStat, rightStat) ->
{
       // can drop when there is only one unique value.
       final C leftMax = leftStat.genericGetMax();
       final C rightMax = rightStat.genericGetMax();
@@ -200,17 +200,17 @@ public class ParquetComparisonPredicates<C extends Comparable<C>>
extends Logica
   ) {
     switch (function) {
       case FunctionGenerationHelper.EQ:
-        return ParquetComparisonPredicates.<C>createEqualPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createEqualPredicate(left, right);
       case FunctionGenerationHelper.GT:
-        return ParquetComparisonPredicates.<C>createGTPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createGTPredicate(left, right);
       case FunctionGenerationHelper.GE:
-        return ParquetComparisonPredicates.<C>createGEPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createGEPredicate(left, right);
       case FunctionGenerationHelper.LT:
-        return ParquetComparisonPredicates.<C>createLTPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createLTPredicate(left, right);
       case FunctionGenerationHelper.LE:
-        return ParquetComparisonPredicates.<C>createLEPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createLEPredicate(left, right);
       case FunctionGenerationHelper.NE:
-        return ParquetComparisonPredicates.<C>createNEPredicate(left, right);
+        return ParquetComparisonPredicate.<C>createNEPredicate(left, right);
       default:
         return null;
     }
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/ParquetIsPredicate.java
similarity index 90%
rename from exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicates.java
rename to exec/java-exec/src/main/java/org/apache/drill/exec/expr/stat/ParquetIsPredicate.java
index d83f389..9b04102 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/ParquetIsPredicate.java
@@ -37,13 +37,13 @@ import static org.apache.drill.exec.expr.stat.ParquetPredicatesHelper.isNullOrEm
 /**
  * IS predicates for parquet filter pushdown.
  */
-public class ParquetIsPredicates <C extends Comparable<C>> extends LogicalExpressionBase
+public class ParquetIsPredicate<C extends Comparable<C>> extends LogicalExpressionBase
     implements ParquetFilterPredicate<C> {
 
   private final LogicalExpression expr;
   private final BiPredicate<Statistics<C>, RangeExprEvaluator<C>> predicate;
 
-  private ParquetIsPredicates(LogicalExpression expr, BiPredicate<Statistics<C>,
RangeExprEvaluator<C>> predicate) {
+  private ParquetIsPredicate(LogicalExpression expr, BiPredicate<Statistics<C>,
RangeExprEvaluator<C>> predicate) {
     super(expr.getPosition());
     this.expr = expr;
     this.predicate = predicate;
@@ -75,7 +75,7 @@ public class ParquetIsPredicates <C extends Comparable<C>> extends
LogicalExpres
    * IS NULL predicate.
    */
   private static <C extends Comparable<C>> LogicalExpression createIsNullPredicate(LogicalExpression
expr) {
-    return new ParquetIsPredicates<C>(expr,
+    return new ParquetIsPredicate<C>(expr,
         //if there are no nulls  -> canDrop
         (exprStat, evaluator) -> hasNoNulls(exprStat)) {
       private final boolean isArray = isArray(expr);
@@ -102,7 +102,7 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
    * IS NOT NULL predicate.
    */
   private static <C extends Comparable<C>> LogicalExpression createIsNotNullPredicate(LogicalExpression
expr) {
-    return new ParquetIsPredicates<C>(expr,
+    return new ParquetIsPredicate<C>(expr,
         //if there are all nulls  -> canDrop
         (exprStat, evaluator) -> isAllNulls(exprStat, evaluator.getRowCount())
     );
@@ -112,7 +112,7 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
    * IS TRUE predicate.
    */
   private static LogicalExpression createIsTruePredicate(LogicalExpression expr) {
-    return new ParquetIsPredicates<Boolean>(expr,
+    return new ParquetIsPredicate<Boolean>(expr,
         //if max value is not true or if there are all nulls  -> canDrop
         (exprStat, evaluator) -> !exprStat.genericGetMax().equals(Boolean.TRUE) || isAllNulls(exprStat,
evaluator.getRowCount())
     );
@@ -122,7 +122,7 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
    * IS FALSE predicate.
    */
   private static LogicalExpression createIsFalsePredicate(LogicalExpression expr) {
-    return new ParquetIsPredicates<Boolean>(expr,
+    return new ParquetIsPredicate<Boolean>(expr,
         //if min value is not false or if there are all nulls  -> canDrop
         (exprStat, evaluator) -> !exprStat.genericGetMin().equals(Boolean.FALSE) || isAllNulls(exprStat,
evaluator.getRowCount())
     );
@@ -132,7 +132,7 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
    * IS NOT TRUE predicate.
    */
   private static LogicalExpression createIsNotTruePredicate(LogicalExpression expr) {
-    return new ParquetIsPredicates<Boolean>(expr,
+    return new ParquetIsPredicate<Boolean>(expr,
         //if min value is not false or if there are no nulls  -> canDrop
         (exprStat, evaluator) -> !exprStat.genericGetMin().equals(Boolean.FALSE) &&
hasNoNulls(exprStat)
     );
@@ -142,7 +142,7 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
    * IS NOT FALSE predicate.
    */
   private static LogicalExpression createIsNotFalsePredicate(LogicalExpression expr) {
-    return new ParquetIsPredicates<Boolean>(expr,
+    return new ParquetIsPredicate<Boolean>(expr,
         //if max value is not true or if there are no nulls  -> canDrop
         (exprStat, evaluator) -> !exprStat.genericGetMax().equals(Boolean.TRUE) &&
hasNoNulls(exprStat)
     );
@@ -151,9 +151,9 @@ public class ParquetIsPredicates <C extends Comparable<C>>
extends LogicalExpres
   public static <C extends Comparable<C>> LogicalExpression createIsPredicate(String
function, LogicalExpression expr) {
     switch (function) {
       case FunctionGenerationHelper.IS_NULL:
-        return ParquetIsPredicates.<C>createIsNullPredicate(expr);
+        return ParquetIsPredicate.<C>createIsNullPredicate(expr);
       case FunctionGenerationHelper.IS_NOT_NULL:
-        return ParquetIsPredicates.<C>createIsNotNullPredicate(expr);
+        return ParquetIsPredicate.<C>createIsNotNullPredicate(expr);
       case FunctionGenerationHelper.IS_TRUE:
         return createIsTruePredicate(expr);
       case FunctionGenerationHelper.IS_NOT_TRUE:
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
index b062bcc..f45edbb 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
@@ -40,10 +40,10 @@ import org.apache.drill.exec.expr.holders.TimeHolder;
 import org.apache.drill.exec.expr.holders.TimeStampHolder;
 import org.apache.drill.exec.expr.holders.ValueHolder;
 import org.apache.drill.exec.expr.holders.VarDecimalHolder;
-import org.apache.drill.exec.expr.stat.ParquetBooleanPredicates;
-import org.apache.drill.exec.expr.stat.ParquetComparisonPredicates;
+import org.apache.drill.exec.expr.stat.ParquetBooleanPredicate;
+import org.apache.drill.exec.expr.stat.ParquetComparisonPredicate;
 import org.apache.drill.exec.expr.stat.ParquetFilterPredicate;
-import org.apache.drill.exec.expr.stat.ParquetIsPredicates;
+import org.apache.drill.exec.expr.stat.ParquetIsPredicate;
 import org.apache.drill.exec.ops.UdfUtilities;
 import org.apache.drill.exec.util.DecimalUtility;
 import org.slf4j.Logger;
@@ -159,7 +159,7 @@ public class ParquetFilterBuilder extends AbstractExprVisitor<LogicalExpression,
       } else {
         if (childPredicate instanceof TypedFieldExpr) {
           // Calcite simplifies `= true` expression to field name, wrap it with is true predicate
-          childPredicate = ParquetIsPredicates.createIsPredicate(FunctionGenerationHelper.IS_TRUE,
childPredicate);
+          childPredicate = ParquetIsPredicate.createIsPredicate(FunctionGenerationHelper.IS_TRUE,
childPredicate);
         }
         childPredicates.add(childPredicate);
       }
@@ -170,7 +170,7 @@ public class ParquetFilterBuilder extends AbstractExprVisitor<LogicalExpression,
     } else if (childPredicates.size() == 1) {
       return childPredicates.get(0); // only one leg is qualified, remove boolean op.
     } else {
-      return ParquetBooleanPredicates.createBooleanPredicate(functionName, op.getName(),
childPredicates, op.getPosition());
+      return ParquetBooleanPredicate.createBooleanPredicate(functionName, op.getName(), childPredicates,
op.getPosition());
     }
   }
 
@@ -268,7 +268,7 @@ public class ParquetFilterBuilder extends AbstractExprVisitor<LogicalExpression,
 
     String funcName = ((DrillSimpleFuncHolder) functionHolderExpression.getHolder()).getRegisteredNames()[0];
 
-    return ParquetComparisonPredicates.createComparisonPredicate(funcName, newArgs.get(0),
newArgs.get(1));
+    return ParquetComparisonPredicate.createComparisonPredicate(funcName, newArgs.get(0),
newArgs.get(1));
   }
 
   private LogicalExpression handleIsFunction(FunctionHolderExpression functionHolderExpression,
Set<LogicalExpression> value) {
@@ -283,7 +283,7 @@ public class ParquetFilterBuilder extends AbstractExprVisitor<LogicalExpression,
     }
     LogicalExpression arg = functionHolderExpression.args.get(0);
 
-    return ParquetIsPredicates.createIsPredicate(funcName, arg.accept(this, value));
+    return ParquetIsPredicate.createIsPredicate(funcName, arg.accept(this, value));
   }
 
   private static boolean isCompareFunction(String funcName) {

-- 
To stop receiving notification emails like this one, please contact
timothyfarkas@apache.org.

Mime
View raw message