Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2445#discussion_r201891274
  
    --- Diff: 
datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMap.java
 ---
    @@ -186,19 +188,39 @@ public void initIndexColumnConverters(CarbonTable 
carbonTable, List<CarbonColumn
             column = ((ColumnExpression) left).getColumnName();
             if (this.name2Col.containsKey(column)) {
               BloomQueryModel bloomQueryModel =
    -              buildQueryModelFromExpression((ColumnExpression) left, 
(LiteralExpression) right);
    +              buildQueryModelForEqual((ColumnExpression) left, 
(LiteralExpression) right);
               queryModels.add(bloomQueryModel);
             }
             return queryModels;
           } else if (left instanceof LiteralExpression && right instanceof 
ColumnExpression) {
             column = ((ColumnExpression) right).getColumnName();
             if (this.name2Col.containsKey(column)) {
               BloomQueryModel bloomQueryModel =
    -              buildQueryModelFromExpression((ColumnExpression) right, 
(LiteralExpression) left);
    +              buildQueryModelForEqual((ColumnExpression) right, 
(LiteralExpression) left);
               queryModels.add(bloomQueryModel);
             }
             return queryModels;
           }
    +    } else if (expression instanceof InExpression) {
    +      Expression left = ((InExpression) expression).getLeft();
    +      Expression right = ((InExpression) expression).getRight();
    +      String column;
    +      if (left instanceof ColumnExpression && right instanceof 
ListExpression) {
    +        column = ((ColumnExpression) left).getColumnName();
    +        if (this.name2Col.containsKey(column)) {
    +          List<BloomQueryModel> models =
    +              buildQueryModelForIn((ColumnExpression) left, 
(ListExpression) right);
    +          queryModels.addAll(models);
    +        }
    +        return queryModels;
    +      } else if (left instanceof ListExpression && right instanceof 
ColumnExpression) {
    +        column = ((ColumnExpression) right).getColumnName();
    +        if (this.name2Col.containsKey(column)) {
    +          List<BloomQueryModel> models =
    +              buildQueryModelForIn((ColumnExpression) right, 
(ListExpression) left);
    +          queryModels.addAll(models);
    +        }
    +      }
    --- End diff --
    
    What if it does not fit into previous two if branch? can you add an else to 
throw exception and explain it will not come to else?


---

Reply via email to