zhangbutao commented on code in PR #4645:
URL: https://github.com/apache/hive/pull/4645#discussion_r1315046843


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -201,6 +200,15 @@ public List<InputSplit> getSplits(JobContext context) {
         .ofNullable(HiveIcebergStorageHandler.table(conf, 
conf.get(InputFormatConfig.TABLE_IDENTIFIER)))
         .orElseGet(() -> Catalogs.loadTable(conf));
 
+    if (conf.get(InputFormatConfig.TABLE_IDENTIFIER) == null) {
+      conf.set(InputFormatConfig.TABLE_IDENTIFIER, table.name());

Review Comment:
   I think we do not need this param. We can just use` table.name()`, 



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -296,7 +303,8 @@ public void initialize(InputSplit split, TaskAttemptContext 
newContext) {
       CombinedScanTask task = ((IcebergSplit) split).task();
       this.context = newContext;
       this.conf = newContext.getConfiguration();
-      this.table = ((IcebergSplit) split).table();
+      this.table = SerializationUtil.deserializeFromBase64(
+                conf.get(InputFormatConfig.SERIALIZED_TABLE_PREFIX + 
conf.get(InputFormatConfig.TABLE_IDENTIFIER)));

Review Comment:
   ```suggestion
                   conf.get(InputFormatConfig.SERIALIZED_TABLE_PREFIX + 
table.name()));
   ```



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java:
##########
@@ -201,6 +200,15 @@ public List<InputSplit> getSplits(JobContext context) {
         .ofNullable(HiveIcebergStorageHandler.table(conf, 
conf.get(InputFormatConfig.TABLE_IDENTIFIER)))
         .orElseGet(() -> Catalogs.loadTable(conf));
 
+    if (conf.get(InputFormatConfig.TABLE_IDENTIFIER) == null) {
+      conf.set(InputFormatConfig.TABLE_IDENTIFIER, table.name());
+    }
+
+    if (conf.get(InputFormatConfig.SERIALIZED_TABLE_PREFIX + 
conf.get(InputFormatConfig.TABLE_IDENTIFIER)) == null) {
+      conf.set(InputFormatConfig.SERIALIZED_TABLE_PREFIX + 
conf.get(InputFormatConfig.TABLE_IDENTIFIER),

Review Comment:
   I almost see what you mean. thx



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