[ https://issues.apache.org/jira/browse/HIVE-25007?focusedWorklogId=582353&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-582353 ]
ASF GitHub Bot logged work on HIVE-25007: ----------------------------------------- Author: ASF GitHub Bot Created on: 14/Apr/21 10:18 Start Date: 14/Apr/21 10:18 Worklog Time Spent: 10m Work Description: marton-bod commented on a change in pull request #2178: URL: https://github.com/apache/hive/pull/2178#discussion_r613122023 ########## File path: iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java ########## @@ -143,19 +145,30 @@ public void commitJob(JobContext originalContext) throws IOException { LOG.info("Committing job has started for table: {}, using location: {}", table, generateJobLocation(conf, jobContext.getJobID())); - FileIO io = HiveIcebergStorageHandler.io(jobContext.getJobConf()); - List<DataFile> dataFiles = dataFiles(jobContext, io, true); - - if (dataFiles.size() > 0) { + List<DataFile> dataFiles = dataFiles(jobContext, table.io(), true); + + boolean isOverwrite = conf.getBoolean(InputFormatConfig.IS_OVERWRITE, false); + if (isOverwrite) { + // Replacing affected partitions (or whole table) since it's an insert overwrite + // We do the replacement even for 0 data files (i.e. empty source) + ReplacePartitions overwrite = table.newReplacePartitions(); + dataFiles.forEach(overwrite::addFile); + overwrite.commit(); Review comment: Actually, there is `ReplacePartitions validateAppendOnly()`, but I'm not sure yet what it does. Let me take a look -- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 582353) Time Spent: 50m (was: 40m) > Implement insert overwrite for Iceberg tables > --------------------------------------------- > > Key: HIVE-25007 > URL: https://issues.apache.org/jira/browse/HIVE-25007 > Project: Hive > Issue Type: New Feature > Reporter: Marton Bod > Assignee: Marton Bod > Priority: Major > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)