[
https://issues.apache.org/jira/browse/FLINK-2210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587577#comment-14587577
]
ASF GitHub Bot commented on FLINK-2210:
---------------------------------------
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/834#discussion_r32495598
--- Diff:
flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/codegen/ExpressionCodeGenerator.scala
---
@@ -489,6 +489,25 @@ abstract class ExpressionCodeGenerator[R](
""".stripMargin
}
+ case NumericIsNotNull(child) =>
+ val childCode = generateExpression(child)
+ if (nullCheck) {
+ childCode.code +
+ s"""
+ |boolean $nullTerm = ${childCode.nullTerm};
+ |if ($nullTerm) {
+ | 0;
+ |} else {
+ | $resultTpe $resultTerm =
Boolean.compare((${childCode.resultTerm} != null),false);
+ |}
+ """.stripMargin
+ } else {
+ childCode.code +
+ s"""
+ |$resultTpe $resultTerm =
Boolean.compare((${childCode.resultTerm} != null),false);
--- End diff --
See above.
> Table API aggregate by ignoring null values
> -------------------------------------------
>
> Key: FLINK-2210
> URL: https://issues.apache.org/jira/browse/FLINK-2210
> Project: Flink
> Issue Type: Bug
> Reporter: Shiti Saxena
> Assignee: Shiti Saxena
> Priority: Minor
>
> Attempting to aggregate on columns which may have null values results in
> NullPointerException.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)