[
https://issues.apache.org/jira/browse/HIVE-26868?focusedWorklogId=836385&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-836385
]
ASF GitHub Bot logged work on HIVE-26868:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Jan/23 10:43
Start Date: 02/Jan/23 10:43
Worklog Time Spent: 10m
Work Description: ayushtkn commented on code in PR #3872:
URL: https://github.com/apache/hive/pull/3872#discussion_r1059955353
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -582,6 +582,11 @@ public void validateSinkDesc(FileSinkDesc sinkDesc) throws
SemanticException {
HiveStorageHandler.super.validateSinkDesc(sinkDesc);
if (sinkDesc.getInsertOverwrite()) {
Table table = IcebergTableUtil.getTable(conf,
sinkDesc.getTableInfo().getProperties());
+ if (table.currentSnapshot() != null &&
+ "0"
.equalsIgnoreCase(table.currentSnapshot().summary().get(SnapshotSummary.TOTAL_RECORDS_PROP)))
{
Review Comment:
Changed to compare to Long.
Regarding moving the check below, I don't think we need to throw in case of
bucketed tables as well, if we establish that the table is empty. That check
was added as part of
[HIVE-25849](https://issues.apache.org/jira/browse/HIVE-25849) in order to
prevent overwriting wrong data or duplications but in case we establish the
table is empty, this no longer holds true
https://github.com/apache/hive/pull/2856#issue-1074445457
Issue Time Tracking
-------------------
Worklog Id: (was: 836385)
Time Spent: 50m (was: 40m)
> Iceberg: Allow IOW on empty table with Partition Evolution
> ----------------------------------------------------------
>
> Key: HIVE-26868
> URL: https://issues.apache.org/jira/browse/HIVE-26868
> Project: Hive
> Issue Type: Improvement
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> In case an iceberg table has gone through partition evolution, we don't allow
> an IOW operation on it.
> But if it is empty, we can allow an IOW since there ain't any data which can
> get messed by overwrite.
> This helps to compact data, & merge the delete files into data file
> via
> Truncate -> IOW with Snapshot ID before Truncate.
> Same flow is used by Impala for compacting Iceberg tables.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)