docete commented on a change in pull request #11727: [FLINK-17106][table]
Support create and drop view in Flink SQL
URL: https://github.com/apache/flink/pull/11727#discussion_r410192416
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/sqlexec/SqlToOperationConverter.java
##########
@@ -415,6 +431,59 @@ private Operation convertAlterDatabase(SqlAlterDatabase
sqlAlterDatabase) {
return new AlterDatabaseOperation(catalogName, databaseName,
catalogDatabase);
}
+ /** Convert CREATE VIEW statement. */
+ private Operation convertCreateView(SqlCreateView sqlCreateView) {
+ final SqlNode query = sqlCreateView.getQuery();
+ final SqlNodeList fieldList = sqlCreateView.getFieldList();
+
+ SqlNode validateQuery = flinkPlanner.validate(query);
+ PlannerQueryOperation operation =
toQueryOperation(flinkPlanner, validateQuery);
+ TableSchema schema = operation.getTableSchema();
+
+ if (!fieldList.getList().isEmpty()) {
Review comment:
ditto, fieldList is optional in view definition.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services