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

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


The following commit(s) were added to refs/heads/master by this push:
     new c3f875eac IMPALA-12683: Fix wrong event time for batched events
c3f875eac is described below

commit c3f875eac42c48ddad4762fb8463a7ebf59b0cf7
Author: stiga-huang <[email protected]>
AuthorDate: Fri Jan 5 18:53:39 2024 +0800

    IMPALA-12683: Fix wrong event time for batched events
    
    When updating the last-synced-event-id after processing a batch of
    partition events, we use the last event id. We should do the same when
    updating last-synced-event-time. However, currently BatchPartitionEvent
    uses getEventTime() from the parent class. It actually returns the event
    time of the first event. We should override it to use the last event.
    
    Tests
     - Ran MetastoreEventsProcessorTest.testDisableEventSyncFlag 200 times.
    
    Change-Id: I82efe18dd28fe8af47f8c66cc8c5eb8e6f8dfd2b
    Reviewed-on: http://gerrit.cloudera.org:8080/20864
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 .../java/org/apache/impala/catalog/events/MetastoreEvents.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java 
b/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java
index f6ffdb1b5..062b9fd84 100644
--- a/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java
+++ b/fe/src/main/java/org/apache/impala/catalog/events/MetastoreEvents.java
@@ -2391,6 +2391,15 @@ public class MetastoreEvents {
       return batchedEvents_.get(batchedEvents_.size()-1).getEventId();
     }
 
+    /**
+     * Same as the above but returns the event time.
+     */
+    @Override
+    public long getEventTime() {
+      Preconditions.checkState(!batchedEvents_.isEmpty());
+      return batchedEvents_.get(batchedEvents_.size() - 1).getEventTime();
+    }
+
     /**
      *
      * @param event The event under consideration to be batched into this 
event. It can

Reply via email to