You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/05/28 16:49:56 UTC

[GitHub] [carbondata] BJangir commented on a change in pull request #3238: [CARBONDATA-3397]Remove SparkUnknown Expression to Index Server

BJangir commented on a change in pull request #3238: [CARBONDATA-3397]Remove SparkUnknown Expression to Index Server
URL: https://github.com/apache/carbondata/pull/3238#discussion_r288202566
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/scan/filter/FilterExpressionProcessor.java
 ##########
 @@ -487,4 +489,47 @@ public static boolean isScanRequired(FilterExecuter filterExecuter, byte[][] max
       return !bitSet.isEmpty();
     }
   }
+
+  /**
+   * Remove UnknownExpression and change to TrueExpression
+   *
+   * @param expressionTree
+   * @return expressionTree without UnknownExpression
+   */
+  public Expression removeUnknownExpression(Expression expressionTree) {
+    ExpressionType filterExpressionType = expressionTree.getFilterExpressionType();
+    BinaryExpression currentExpression = null;
+    switch (filterExpressionType) {
+      case OR:
+        currentExpression = (BinaryExpression) expressionTree;
+        return new OrExpression(
+                removeUnknownExpression(currentExpression.getLeft()),
+                removeUnknownExpression(currentExpression.getRight())
+        );
+      case AND:
+        currentExpression = (BinaryExpression) expressionTree;
+        return new AndExpression(
+                removeUnknownExpression(currentExpression.getLeft()),
+                removeUnknownExpression(currentExpression.getRight())
+        );
+      case UNKNOWN:
+        return new TrueExpression(null);
+      default:
+        return expressionTree;
+    }
+  }
+
+  /**
+   * Change UnknownReslover to TrueExpression Reslover.
+   *
+   * @param expressionTree
+   * @param tableIdentifier
+   * @return
+   */
+  public FilterResolverIntf changeUnknownResloverToTrue(Expression expressionTree,
 
 Review comment:
   Done

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


With regards,
Apache Git Services