[
https://issues.apache.org/jira/browse/FLINK-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241194#comment-15241194
]
ASF GitHub Bot commented on FLINK-3739:
---------------------------------------
Github user yjshen commented on the pull request:
https://github.com/apache/flink/pull/1880#issuecomment-209954946
I happened to have context here for `primitiveDefaultValue`, I think this
was originated from Apache Spark's counterpart for create default values for an
expression. Let me summarize how it is used to calculate scalar expression's
result in Spark:
```
boolean ${result.isNull} = false;
$javaType ${result.value} = ${ctx.defaultValue(type)};
if (result is not null for some input) {
${result.value} = calculated result;
} else {
${result.isNull} = true;
}
```
Therefore, after the evaluation of this expression, if the result is Null,
the `isNull` field is set to `True` and no more touches on `value` field, if
not null, the `result.value` point to the final result. The default value is
never used.
> Add a null literal to Table API
> -------------------------------
>
> Key: FLINK-3739
> URL: https://issues.apache.org/jira/browse/FLINK-3739
> Project: Flink
> Issue Type: Improvement
> Components: Table API
> Reporter: Timo Walther
> Assignee: Timo Walther
>
> The Table API needs support for the null literal e.g. for passing null values
> to functions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)