carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [27/50] carbondata git commit: [CARBONDATA-2774][BloomDataMap] Exception should be thrown if expression do not satisfy bloomFilter's requirement
Date Mon, 30 Jul 2018 18:42:53 GMT
[CARBONDATA-2774][BloomDataMap] Exception should be thrown if expression do not satisfy bloomFilter's
requirement

If query on string column with bloom index using number as filter value, we would get wrong
result. Because DDL will wrap the filter with a datatype conversion, and DatamapChooser chooses
datamap by searching column deep down to all children of filter expression. However, bloom
filter required the expression is simply column =/in filterValue. So bloom will fail to build
any querymodel and no hit blocklet, such that we will get an empty result.

To avoid getting wrong answer silently, we thrown exception instead of only giving a error
log currently.

For users who wants to get correct result, can fix the SQL using corresponding data type or
disable bloom datamap.

This closes #2545


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

Branch: refs/heads/branch-1.4
Commit: 66285abe294b4611ed55b462b121cadd1c9619d5
Parents: da2f038
Author: Manhua <kevinjmh@qq.com>
Authored: Tue Jul 24 14:51:18 2018 +0800
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Tue Jul 31 00:11:26 2018 +0530

----------------------------------------------------------------------
 .../carbondata/datamap/bloom/BloomCoarseGrainDataMap.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/66285abe/datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
----------------------------------------------------------------------
diff --git a/datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
b/datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
index 26db300..be531d6 100644
--- a/datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
+++ b/datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
@@ -203,7 +203,9 @@ public class BloomCoarseGrainDataMap extends CoarseGrainDataMap {
         }
         return queryModels;
       } else {
-        LOGGER.warn("BloomFilter can only support the 'equal' filter like 'Col = PlainValue'");
+        String errorMsg = "BloomFilter can only support the 'equal' filter like 'Col = PlainValue'";
+        LOGGER.warn(errorMsg);
+        throw new RuntimeException(errorMsg);
       }
     } else if (expression instanceof InExpression) {
       Expression left = ((InExpression) expression).getLeft();
@@ -226,7 +228,9 @@ public class BloomCoarseGrainDataMap extends CoarseGrainDataMap {
         }
         return queryModels;
       } else {
-        LOGGER.warn("BloomFilter can only support the 'in' filter like 'Col in (PlainValues)'");
+        String errorMsg = "BloomFilter can only support the 'in' filter like 'Col in PlainValue'";
+        LOGGER.warn(errorMsg);
+        throw new RuntimeException(errorMsg);
       }
     }
 


Mime
View raw message