[
https://issues.apache.org/jira/browse/FLINK-18325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jiatao Tao updated FLINK-18325:
-------------------------------
Summary: NPE may throw when use SqlDataTypeSpec#getNullable (was:
SqlMapTypeNameSpec#unparse may throw NPE)
> NPE may throw when use SqlDataTypeSpec#getNullable
> --------------------------------------------------
>
> Key: FLINK-18325
> URL: https://issues.apache.org/jira/browse/FLINK-18325
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Runtime
> Reporter: Jiatao Tao
> Priority: Critical
> Attachments: image-2020-06-16-18-53-17-462.png
>
>
> SqlMapTypeNameSpec#unparse calls SqlDataTypeSpec#getNullable, and
> "getNullable" may throw NPE
> {code:java}
> if (!keyType.getNullable()) {
> writer.keyword("NOT NULL");
> }
> {code}
>
> See in SqlDataTypeSpec
> {code:java}
> /** Whether data type allows nulls.
> *
> * <p>Nullable is nullable! Null means "not specified". E.g.
> * {@code CAST(x AS INTEGER)} preserves the same nullability as {@code x}.
> */
> private Boolean nullable;
> {code}
>
> This API is from calcite, and all callers will determine if it is null:
> !image-2020-06-16-18-53-17-462.png|width=488,height=114!
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)