carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geetikagupta16 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1650: [CARBONDATA-1703] Refactored code for creatio...
Date Thu, 28 Dec 2017 06:50:01 GMT
Github user geetikagupta16 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1650#discussion_r158903934
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonFilters.scala
---
    @@ -78,13 +78,25 @@ object CarbonFilters {
               Some(new LessThanEqualToExpression(getCarbonExpression(name),
                 getCarbonLiteralExpression(name, value)))
             case sources.In(name, values) =>
    -          Some(new InExpression(getCarbonExpression(name),
    -            new ListExpression(
    -              convertToJavaList(values.map(f => getCarbonLiteralExpression(name, f)).toList))))
    +          if (values.length == 1 && values(0) == null) {
    +            Some(new InExpression(getCarbonExpression(name),
    +              new ListExpression(
    +                convertToJavaList(values.map(filterValues =>
    +                  getCarbonLiteralExpression(name, filterValues)).toList))))
    +          } else {
    +            Some(new InExpression(getCarbonExpression(name),
    +              new ListExpression(
    +                convertToJavaList(values.filterNot(_ == null)
    +                  .map(filterValues => getCarbonLiteralExpression(name, filterValues)).toList))))
    +          }
             case sources.Not(sources.In(name, values)) =>
    -          Some(new NotInExpression(getCarbonExpression(name),
    -            new ListExpression(
    -              convertToJavaList(values.map(f => getCarbonLiteralExpression(name, f)).toList))))
    +          if (values.contains(null)) {
    +            Some(new FalseExpression(getCarbonExpression(name)))
    +          } else {
    +            Some(new NotInExpression(getCarbonExpression(name),
    --- End diff --
    
    Can you please provide scenario for the same


---

Mime
View raw message