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/03/13 02:49:17 UTC

[GitHub] [carbondata] QiangCai commented on a change in pull request #3145: [CARBONDATA-3315] Fix for Range Filter failing with two between clauses as children of OR expression

QiangCai commented on a change in pull request #3145: [CARBONDATA-3315] Fix for Range Filter failing with two between clauses as children of OR expression
URL: https://github.com/apache/carbondata/pull/3145#discussion_r264957973
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/scan/expression/RangeExpressionEvaluator.java
 ##########
 @@ -223,12 +223,24 @@ private void fillExpressionMap(Map<String, List<FilterModificationNode>> filterE
       addFilterExpressionMap(filterExpressionMap, currentNode, parentNode);
     }
 
-    for (Expression exp : currentNode.getChildren()) {
-      if (null != exp) {
-        fillExpressionMap(filterExpressionMap, exp, currentNode);
-        if (exp instanceof OrExpression) {
-          replaceWithRangeExpression(filterExpressionMap);
-          filterExpressionMap.clear();
+    // In case of Or Exp we have to evaluate both the subtrees of expression separately
+    // else it will combine the results of both the subtrees into one expression
+    // which wont give us correct result
+    if (currentNode instanceof OrExpression) {
+      if (null != ((OrExpression) currentNode).left) {
+        fillExpressionMap(filterExpressionMap, ((OrExpression) currentNode).left, currentNode);
 
 Review comment:
   maybe there were some nodes in filterExpressionMap already.

----------------------------------------------------------------
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