flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] xueyumusic commented on a change in pull request #7079: [FLINK-10845][table] Support multiple different DISTINCT aggregates for batch
Date Tue, 04 Dec 2018 15:51:17 GMT
xueyumusic commented on a change in pull request #7079: [FLINK-10845][table] Support multiple
different DISTINCT aggregates for batch
URL: https://github.com/apache/flink/pull/7079#discussion_r238720519
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/ScalarOperators.scala
 ##########
 @@ -191,7 +191,17 @@ object ScalarOperators {
           )
         )
     }
-  }  
+  }
+
+  def generateDistinctFrom(
+      nullCheck: Boolean,
+      left: GeneratedExpression,
+      right: GeneratedExpression)
+    : GeneratedExpression = {
+    val newleft = left.copy(nullTerm = GeneratedExpression.NEVER_NULL)
 
 Review comment:
   @twalthr I thought the similar way ago and met a problem. If we check left is null then
need to generate left code first. However in generateEqual (generateOperatorIfNotNull) it
also generate left code, such as 
   ```
   ${left.code}
   ${right.code}
   if (${left.nullTerm}) {
     return ${right.nullTerm}
   } else if (${right.nullTerm}) {
     return ${left.nullTerm}
   } else {
     return generateEqual(left, right)
    (here will also generate ${left.code} and ${right.code} in generateOperatorIfNotNull)
   }
   ```
   I don't know how to make left and right code generate once if don't modify generateOperatorIfNotNull..

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message