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