flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jark Wu (Jira)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-14296) SqlNodes in the parser module should use an Optional for optional parameters
Date Sun, 06 Oct 2019 02:09:00 GMT

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

Jark Wu commented on FLINK-14296:
---------------------------------

I agree with [~wind_ljy]. {{SqlNodeList}} is a List of SqlNode. We can check {{isEmpty}} on
the List instead of checking against null.

> 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