[
https://issues.apache.org/jira/browse/HIVE-25325?focusedWorklogId=624380&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-624380
]
ASF GitHub Bot logged work on HIVE-25325:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jul/21 14:18
Start Date: 19/Jul/21 14:18
Worklog Time Spent: 10m
Work Description: kuczoram commented on a change in pull request #2471:
URL: https://github.com/apache/hive/pull/2471#discussion_r672339586
##########
File path:
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerWithEngine.java
##########
@@ -1313,6 +1313,186 @@ public void testScanTableCaseInsensitive() throws
IOException {
Assert.assertArrayEquals(new Object[] {1L, "Bob", "Green"}, rows.get(1));
}
+ @Test
+ public void testTruncateTable() throws IOException, TException,
InterruptedException {
+ // Create an Iceberg table with some records in it then execute a truncate
table command.
+ // Then check if the data is deleted and the table statistics are reset to
0.
+ String databaseName = "default";
+ String tableName = "customers";
+ Table icebergTable = testTables.createTable(shell, tableName,
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
+ fileFormat, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
+ testTruncateTable(databaseName, tableName, icebergTable,
HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS,
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, true, false);
+ }
+
+ @Test
+ public void testTruncateEmptyTable() throws IOException, TException,
InterruptedException {
+ // Create an empty Iceberg table and execute a truncate table command on
it.
+ String databaseName = "default";
+ String tableName = "customers";
+ String fullTableName = databaseName + "." + tableName;
Review comment:
Thanks, I changed that.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 624380)
Time Spent: 1h 10m (was: 1h)
> Add TRUNCATE TABLE support for Hive Iceberg tables
> --------------------------------------------------
>
> Key: HIVE-25325
> URL: https://issues.apache.org/jira/browse/HIVE-25325
> Project: Hive
> Issue Type: Improvement
> Reporter: Marta Kuczora
> Assignee: Marta Kuczora
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Implement the TRUNCATE operation for Hive Iceberg tables. Since these tables
> are unpartitioned in Hive, only the truncate unpartitioned table use case has
> to be supported.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)