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

    https://github.com/apache/carbondata/pull/2453#discussion_r202504966
  
    --- Diff: 
datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVHelper.scala 
---
    @@ -147,6 +149,34 @@ object MVHelper {
         }.filter(_.isDefined).map(_.get)
       }
     
    +
    +  /**
    +   * Check if we can do incremental load on the mv table. Some cases like 
aggregation functions
    +   * which are present inside other expressions like sum(a)+sum(b) cannot 
be incremental loaded.
    +   */
    +  private def isFullReload(logicalPlan: LogicalPlan): Boolean = {
    +    var isFullReload = false
    +    logicalPlan.transformAllExpressions {
    +      case a: Alias =>
    +        a
    +      case agg: AggregateExpression => agg
    +      case c: Cast =>
    +        isFullReload = c.child.find {
    +          case agg: AggregateExpression => false
    +          case _ => false
    +        }.isDefined || isFullReload
    +        c
    +      case exp: Expression =>
    +        // Check any aggregation function present inside other expression.
    +        isFullReload = exp.find {
    +          case agg: AggregateExpression => true
    --- End diff --
    
    Can you modify comment to tell like `return true if .... `



---

Reply via email to