carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sounakr <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #805: [CARBONDATA-934] Cast Filter Express...
Date Fri, 21 Apr 2017 12:19:27 GMT
Github user sounakr commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/805#discussion_r112674727
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/CarbonLateDecodeStrategy.scala
---
    @@ -396,43 +402,41 @@ private[sql] class CarbonLateDecodeStrategy extends SparkStrategy
{
         (unrecognizedPredicates ++ unhandledPredicates, translatedFilters)
       }
     
    +
       /**
        * Tries to translate a Catalyst [[Expression]] into data source [[Filter]].
        * @return a `Some[Filter]` if the input [[Expression]] is convertible, otherwise a
`None`.
        */
    -  protected[sql] def translateFilter(predicate: Expression, or: Boolean = false): Option[Filter]
= {
    +  protected[sql] def translateFilter(predicate: Expression): Option[Filter] = {
         predicate match {
           case or@Or(left, right) =>
     
    -        val leftFilter = translateFilter(left, true)
    -        val rightFilter = translateFilter(right, true)
    +        val leftFilter = translateFilter(left)
    +        val rightFilter = translateFilter(right)
             if (leftFilter.isDefined && rightFilter.isDefined) {
               Some(sources.Or(leftFilter.get, rightFilter.get))
             } else {
               None
             }
     
           case And(left, right) =>
    -        val leftFilter = translateFilter(left, or)
    -        val rightFilter = translateFilter(right, or)
    -        if (or) {
    -          if (leftFilter.isDefined && rightFilter.isDefined) {
    -            (translateFilter(left) ++ translateFilter(right)).reduceOption(sources.And)
    -          } else {
    -            None
    -          }
    -        } else {
    -          (translateFilter(left) ++ translateFilter(right)).reduceOption(sources.And)
    -        }
    -
    +        (translateFilter(left) ++ translateFilter(right)).reduceOption(sources.And)
    --- End diff --
    
    Replaced Back.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message