TuroczyX commented on code in PR #4185:
URL: https://github.com/apache/hive/pull/4185#discussion_r1158442534
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/Catalogs.java:
##########
@@ -222,6 +222,19 @@ public static Table registerTable(Configuration conf,
Properties props, String m
return new HadoopTables(conf).create(schema, spec, map, location);
}
+ public static void renameTable(Configuration conf, Properties props,
TableIdentifier to) {
+ String catalogName = props.getProperty(InputFormatConfig.CATALOG_NAME);
+
+ Optional<Catalog> catalog = loadCatalog(conf, catalogName);
+ if (catalog.isPresent()) {
+ String name = props.getProperty(NAME);
+ Preconditions.checkNotNull(name, "Table identifier not set");
Review Comment:
"Table identifier is not set".
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/Catalogs.java:
##########
@@ -222,6 +222,19 @@ public static Table registerTable(Configuration conf,
Properties props, String m
return new HadoopTables(conf).create(schema, spec, map, location);
}
+ public static void renameTable(Configuration conf, Properties props,
TableIdentifier to) {
+ String catalogName = props.getProperty(InputFormatConfig.CATALOG_NAME);
+
+ Optional<Catalog> catalog = loadCatalog(conf, catalogName);
+ if (catalog.isPresent()) {
+ String name = props.getProperty(NAME);
+ Preconditions.checkNotNull(name, "Table identifier not set");
+ catalog.get().renameTable(TableIdentifier.parse(name), to);
+ } else {
+ throw new RuntimeException("Rename from " + props.getProperty(NAME) + "
to " + to + "failed");
Review Comment:
"failed" a white space is missing from the beginning of failed. Also I think
the " has been failed" is more precise
--
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]