[ 
https://issues.apache.org/jira/browse/HIVE-27208?focusedWorklogId=855050&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-855050
 ]

ASF GitHub Bot logged work on HIVE-27208:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Apr/23 12:22
            Start Date: 05/Apr/23 12:22
    Worklog Time Spent: 10m 
      Work Description: 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





Issue Time Tracking
-------------------

    Worklog Id:     (was: 855050)
    Time Spent: 3h  (was: 2h 50m)

> Iceberg: Add support for rename table
> -------------------------------------
>
>                 Key: HIVE-27208
>                 URL: https://issues.apache.org/jira/browse/HIVE-27208
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Add support for renaming iceberg tables.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to