[
https://issues.apache.org/jira/browse/HIVE-26868?focusedWorklogId=836379&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-836379
]
ASF GitHub Bot logged work on HIVE-26868:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Jan/23 09:53
Start Date: 02/Jan/23 09:53
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on code in PR #3872:
URL: https://github.com/apache/hive/pull/3872#discussion_r1059928248
##########
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:
can we cast to long and compare numbers?
````
Long.parseLong(table.currentSnapshot().summary().get(SnapshotSummary.TOTAL_RECORDS_PROP))
== 0
````
Issue Time Tracking
-------------------
Worklog Id: (was: 836379)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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)