xuefuz commented on a change in pull request #8434: [FLINK-12234][hive] Support
view related operations in HiveCatalog
URL: https://github.com/apache/flink/pull/8434#discussion_r283926412
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -169,8 +181,18 @@ protected Table createHiveTable(ObjectPath tablePath,
CatalogBaseTable table) {
sd.setCols(allColumns);
hiveTable.setPartitionKeys(new ArrayList<>());
}
+ } else if (table instanceof CatalogView) {
+ HiveCatalogView view = (HiveCatalogView) table;
+
+ // TODO: [FLINK-12398] Support partitioned view in
catalog API
+ sd.setCols(allColumns);
+ hiveTable.setPartitionKeys(new ArrayList<>());
+
+ hiveTable.setViewOriginalText(view.getOriginalQuery());
+ hiveTable.setViewExpandedText(view.getExpandedQuery());
+ hiveTable.setTableType(TableType.VIRTUAL_VIEW.name());
} else {
- throw new UnsupportedOperationException("HiveCatalog
doesn't support view yet");
+ throw new CatalogException("HiveCatalog only supports
CatalogTable and CatalogView");
Review comment:
HiveCatalogTable/View?
----------------------------------------------------------------
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