[ 
https://issues.apache.org/jira/browse/FLINK-14858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kurt Young closed FLINK-14858.
------------------------------
    Resolution: Fixed

merged to 1.10.0: 0e4e60517231967b4caf6695e5a606595a9ca088

> Wrong "if" statement in SqlToOperationConverter
> -----------------------------------------------
>
>                 Key: FLINK-14858
>                 URL: https://issues.apache.org/jira/browse/FLINK-14858
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.9.1
>            Reporter: zhaozhangwan
>            Assignee: zhaozhangwan
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In class {{org.apache.flink.table.sqlexec.SqlToOperationConverter}}  
> {code:java}
> public static Optional<Operation> convert(
>       FlinkPlannerImpl flinkPlanner,
>       CatalogManager catalogManager,
>       SqlNode sqlNode) {
>    // validate the query
>    final SqlNode validated = flinkPlanner.validate(sqlNode);
>    SqlToOperationConverter converter = new 
> SqlToOperationConverter(flinkPlanner, catalogManager);
>    if (validated instanceof SqlCreateTable) {
>       return Optional.of(converter.convertCreateTable((SqlCreateTable) 
> validated));
>    } if (validated instanceof SqlDropTable) {  // this should be "else if" 
> not the "if"
>       return Optional.of(converter.convertDropTable((SqlDropTable) 
> validated));
>    } else if (validated instanceof RichSqlInsert) {
>       SqlNodeList targetColumnList = ((RichSqlInsert) 
> validated).getTargetColumnList();
>       if (targetColumnList != null && targetColumnList.size() != 0) {
>          throw new ValidationException("Partial inserts are not supported");
>       }
>       return Optional.of(converter.convertSqlInsert((RichSqlInsert) 
> validated));
>    } else if (validated.getKind().belongsTo(SqlKind.QUERY)) {
>       return Optional.of(converter.convertSqlQuery(validated));
>    } else {
>       return Optional.empty();
>    }
> }{code}
>  



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

Reply via email to