Jiatao Tao created FLINK-18325:
----------------------------------
Summary: SqlMapTypeNameSpec#unparse may throw NPE
Key: FLINK-18325
URL:
https://issues.apache.org/jira/browse/FLINK-18325 Project: Flink
Issue Type: Bug
Components: Table SQL / Runtime
Reporter: Jiatao Tao
Attachments: image-2020-06-16-18-53-17-462.png
SqlMapTypeNameSpec#unparse call 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)