pgaref commented on a change in pull request #1726:
URL: https://github.com/apache/hive/pull/1726#discussion_r566325355



##########
File path: 
storage-api/src/java/org/apache/hadoop/hive/ql/io/sarg/SearchArgumentImpl.java
##########
@@ -330,7 +355,7 @@ public Builder lessThan(String column, PredicateLeaf.Type 
type,
       if (column == null || literal == null) {
         parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL));
       } else {
-        PredicateLeaf leaf =
+        PredicateLeafImpl leaf =

Review comment:
       same

##########
File path: 
storage-api/src/java/org/apache/hadoop/hive/ql/io/sarg/SearchArgumentImpl.java
##########
@@ -345,7 +370,7 @@ public Builder lessThanEquals(String column, 
PredicateLeaf.Type type,
       if (column == null || literal == null) {
         parent.getChildren().add(new ExpressionTree(TruthValue.YES_NO_NULL));
       } else {
-        PredicateLeaf leaf =
+        PredicateLeafImpl leaf =

Review comment:
       same on all alteration below..

##########
File path: 
storage-api/src/java/org/apache/hadoop/hive/ql/io/sarg/SearchArgumentImpl.java
##########
@@ -312,12 +338,11 @@ public Builder end() {
       return this;
     }
 
-    private int addLeaf(PredicateLeaf leaf) {
-      Integer result = leaves.get(leaf);
+    private PredicateLeafImpl addLeaf(PredicateLeafImpl leaf) {

Review comment:
       Argument may change to PredicateLeaf?

##########
File path: 
storage-api/src/java/org/apache/hadoop/hive/ql/io/sarg/ExpressionTree.java
##########
@@ -31,25 +31,25 @@
   public enum Operator {OR, AND, NOT, LEAF, CONSTANT}
   private final Operator operator;
   private final List<ExpressionTree> children;
-  private int leaf;
+  private final PredicateLeaf leaf;
   private final SearchArgument.TruthValue constant;
 
   ExpressionTree() {
     operator = null;
     children = null;
-    leaf = 0;
+    leaf = null;
     constant = null;
   }
 
   ExpressionTree(Operator op, ExpressionTree... kids) {
     operator = op;
-    children = new ArrayList<ExpressionTree>();
-    leaf = -1;
+    children = new ArrayList<>();
+    leaf = null;
     this.constant = null;
     Collections.addAll(children, kids);
   }
 
-  ExpressionTree(int leaf) {
+  ExpressionTree(SearchArgumentImpl.PredicateLeafImpl leaf) {

Review comment:
       This can now become PredicateLeaf




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to