deniskuzZ commented on code in PR #4852:
URL: https://github.com/apache/hive/pull/4852#discussion_r1399063155


##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergV2.java:
##########
@@ -587,31 +602,13 @@ public void testUpdateForSupportedTypes() throws 
IOException {
   }
 
   @Test
-  public void testDeleteStatementFormatV1() {
-    // create and insert an initial batch of records
-    testTables.createTable(shell, "customers", 
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
-        PartitionSpec.unpartitioned(), fileFormat, 
HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_2);
-    // insert one more batch so that we have multiple data files within the 
same partition
-    
shell.executeStatement(testTables.getInsertQuery(HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_1,
-        TableIdentifier.of("default", "customers"), false));
-    AssertHelpers.assertThrows("should throw exception", 
IllegalArgumentException.class,
-        "Attempt to do update or delete on table", () -> {
-          shell.executeStatement("DELETE FROM customers WHERE customer_id=3 or 
first_name='Joanna'");
-        });
+  public void testDeleteStatementFormatV1() throws TException, 
InterruptedException {
+    executeDeleteAndValidateDataUnpartitioned(1);

Review Comment:
   that was a v1 update/delete - wasn't supported before



##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergV2.java:
##########
@@ -587,31 +602,13 @@ public void testUpdateForSupportedTypes() throws 
IOException {
   }
 
   @Test
-  public void testDeleteStatementFormatV1() {
-    // create and insert an initial batch of records
-    testTables.createTable(shell, "customers", 
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
-        PartitionSpec.unpartitioned(), fileFormat, 
HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_2);
-    // insert one more batch so that we have multiple data files within the 
same partition
-    
shell.executeStatement(testTables.getInsertQuery(HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_1,
-        TableIdentifier.of("default", "customers"), false));
-    AssertHelpers.assertThrows("should throw exception", 
IllegalArgumentException.class,
-        "Attempt to do update or delete on table", () -> {
-          shell.executeStatement("DELETE FROM customers WHERE customer_id=3 or 
first_name='Joanna'");
-        });
+  public void testDeleteStatementFormatV1() throws TException, 
InterruptedException {
+    executeDeleteAndValidateDataUnpartitioned(1);
   }
 
   @Test
-  public void testUpdateStatementFormatV1() {
-    // create and insert an initial batch of records
-    testTables.createTable(shell, "customers", 
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
-        PartitionSpec.unpartitioned(), fileFormat, 
HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_2);
-    // insert one more batch so that we have multiple data files within the 
same partition
-    
shell.executeStatement(testTables.getInsertQuery(HiveIcebergStorageHandlerTestUtils.OTHER_CUSTOMER_RECORDS_1,
-        TableIdentifier.of("default", "customers"), false));
-    AssertHelpers.assertThrows("should throw exception", 
IllegalArgumentException.class,
-        "Attempt to do update or delete on table", () -> {
-          shell.executeStatement("UPDATE customers SET last_name='Changed' 
WHERE customer_id=3 or first_name='Joanna'");
-        });
+  public void testUpdateStatementFormatV1() throws TException, 
InterruptedException {
+    executeUpdateAndValidateDataUnpartitioned(1);

Review Comment:
   yes



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

Reply via email to