flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiayi Liao (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLINK-14296) SqlNodes in the parser module should use an Optional for optional parameters
Date Tue, 01 Oct 2019 09:26:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-14296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16941677#comment-16941677
] 

Jiayi Liao edited comment on FLINK-14296 at 10/1/19 9:25 AM:
-------------------------------------------------------------

[~dawidwys] 

Actually the partitionKeyList / columnList / propertyList is an empty SqlNodeList if it's
not included and we do not support primary keys and unique keys now. Maybe we should not check
against null value at all?


was (Author: wind_ljy):
[~dawidwys] 

Actually the partitionKeyList / columnList / propertyList is an empty list if it's not included
and we do not support primary keys and unique keys now. Maybe we should not check against
null value at all?

> SqlNodes in the parser module should use an Optional for optional parameters
> ----------------------------------------------------------------------------
>
>                 Key: FLINK-14296
>                 URL: https://issues.apache.org/jira/browse/FLINK-14296
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: Dawid Wysakowicz
>            Priority: Major
>
> I want to suggest using Optional for optional parameters in classes such as SqlCreateTable/SqlCreateView/SqlTableColumn
etc.
> Right now we must check against null at different locations e.g.:
> {code}
> SqlNodeList partitionKey = sqlCreateTable.getPartitionKeyList();
> if (partitionKey != null) {
> 	partitionKeys = partitionKey
> 		.getList()
> 		.stream()
> 		.map(p -> ((SqlIdentifier) p).getSimple())
> 		.collect(Collectors.toList());
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message