This is an automated email from the ASF dual-hosted git repository.

deniskuzZ pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 985a11a6517 HIVE-29626: Fix testFireInsertEvent() in TestHive (#6502)
985a11a6517 is described below

commit 985a11a65171125b244b066825c14e5673a094e2
Author: Venu Reddy <[email protected]>
AuthorDate: Thu May 21 14:00:07 2026 +0530

    HIVE-29626: Fix testFireInsertEvent() in TestHive (#6502)
---
 .../apache/hadoop/hive/ql/metadata/TestHive.java   | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java 
b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
index b94657f716b..aec90948f9a 100755
--- a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
@@ -1093,6 +1093,7 @@ public void testHiveRefreshOnConfChange() throws 
Throwable{
     assertTrue(prevHiveObj != newHiveObj);
   }
 
+  @Test
   public void testFireInsertEvent() throws Throwable {
     Hive hiveDb = Hive.getWithFastCheck(hiveConf, false);
     String tableName = "test_fire_insert_event";
@@ -1101,6 +1102,18 @@ public void testFireInsertEvent() throws Throwable {
         HiveIgnoreKeyTextOutputFormat.class);
     Table table = hiveDb.getTable(tableName);
     Path tablePath = table.getDataLocation();
+
+    // Fire the InsertEvent with empty folder
+    hiveDb.fireInsertEvent(table, null, false,
+        Lists.newArrayList(new FileStatus(5, true, 1, 64, 100, tablePath)));
+    // Get the last Metastore event
+    InsertEvent insertEvent1 = DummyFireInsertListener.getLastEvent();
+    // Check the event
+    Assert.assertNotNull(insertEvent1);
+    // getFiles should be empty and not null
+    Assert.assertNotNull(insertEvent1.getFiles());
+    Assert.assertTrue(insertEvent1.getFiles().isEmpty());
+
     // Create some files that "inserted"
     FileSystem fileSystem = tablePath.getFileSystem(hiveConf);
     fileSystem.deleteOnExit(tablePath);
@@ -1144,17 +1157,6 @@ public void testFireInsertEvent() throws Throwable {
       Path insertedPath = new Path(insertEvent.getFiles().get(i));
       Assert.assertEquals(expectedCheckSums.get(insertedPath.getName()), 
checkSums.get(i));
     }
-
-    // Fire the InsertEvent with empty folder
-    hiveDb.fireInsertEvent(table, null, false,
-      Lists.newArrayList(new FileStatus(5, true, 1, 64, 100, tablePath)));
-    // Get the last Metastore event
-    InsertEvent insertEvent1 = DummyFireInsertListener.getLastEvent();
-    // Check the event
-    Assert.assertNotNull(insertEvent1);
-    // getFiles should be empty and not null
-    Assert.assertNotNull(insertEvent1.getFiles());
-    Assert.assertTrue(insertEvent1.getFiles().isEmpty());
   }
 
   private String getFileCheckSum(FileSystem fileSystem, Path p) throws 
Exception {

Reply via email to