pvary commented on code in PR #17873:
URL: https://github.com/apache/iceberg/pull/17873#discussion_r3987152848


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java:
##########
@@ -473,6 +571,33 @@ private boolean isReservedProperty(String prop) {
         || 
FlinkCreateTableOptions.SRC_CATALOG_PROPS_KEY.equalsIgnoreCase(prop);
   }
 
+  private void createIcebergView(
+      ObjectPath tablePath, ResolvedCatalogView view, boolean ignoreIfExists)
+      throws CatalogException, TableAlreadyExistException {
+    Map<String, String> properties = Maps.newHashMap(view.getOptions());
+    if (!StringUtils.isNullOrWhitespaceOnly(view.getComment())) {
+      properties.put(ViewProperties.COMMENT, view.getComment());
+    }
+
+    try {
+      // the default catalog is intentionally left unset so that readers 
resolve it to the
+      // name this catalog is registered under (see toCatalogView)
+      asViewCatalog
+          .buildView(toIdentifier(tablePath))
+          .withSchema(FlinkSchemaUtil.convert(view.getResolvedSchema()))
+          .withDefaultNamespace(appendLevel(baseNamespace, 
tablePath.getDatabaseName()))

Review Comment:
   Are we sure that the `tablePath.getDatabaseName()` is correct here?
   We need to sync the query and the namespace.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to