Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-4620

sum(expression) support should be limited since it's not conform the associative law of addition in standard sql

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      In standard sql, there's an edge case for the calculation of expression for a single row. For example, 

      ${col1} + ${col2}
      
      

      if ${col1} or ${col2} is null, the result of this expression should be null. Therefore, the sum aggregation function does not conform the associative law of addition. That is

      sum(col1) + sum(col2) != sum(col1 + col2) 
      
      

       

      To support sum(col1 + col2), we have to predefine the it if null values may exist for the related columns.

      If you want to enable sum(expression) with regarding null as 0, you need to set kylin.query.is-null-as-zero-in-expression to be true at project level

      Attachments

        Issue Links

          Activity

            People

              yaho Zhong Yanghong
              yaho Zhong Yanghong
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: