[
https://issues.apache.org/jira/browse/HIVE-26407?focusedWorklogId=796916&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-796916
]
ASF GitHub Bot logged work on HIVE-26407:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Aug/22 14:28
Start Date: 01/Aug/22 14:28
Worklog Time Spent: 10m
Work Description: InvisibleProgrammer commented on code in PR #3489:
URL: https://github.com/apache/hive/pull/3489#discussion_r934595868
##########
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java:
##########
@@ -1026,6 +1029,38 @@ public void testFindNextCompactThrowsTException() throws
Exception {
verify(msc, times(0)).markFailed(any());
}
+ @Test
+ public void testDoesntGatherStatsIfCompactionFails() throws Exception {
+ try (
+ MockedStatic<Worker.StatsUpdater> statsUpdater =
Mockito.mockStatic(Worker.StatsUpdater.class)) {
+
+ Table t = newTable("default", "mtwb", false);
+
+ addBaseFile(t, null, 20L, 20);
+ addDeltaFile(t, null, 21L, 22L, 2);
+ addDeltaFile(t, null, 23L, 24L, 2);
+
+ burnThroughTransactions("default", "mtwb", 25);
+
+ CompactionRequest rqst = new CompactionRequest("default", "mtwb",
CompactionType.MINOR);
+ String initiatorVersion = "INITIATOR_VERSION";
+ rqst.setInitiatorVersion(initiatorVersion);
+ txnHandler.compact(rqst);
+
+ Worker worker = Mockito.spy(new Worker());
+
+ doThrow(new RuntimeException()).when(worker).getMrCompactor();
+
+ worker.setConf(conf);
+ String workerVersion = "WORKER_VERSION";
+ doReturn(workerVersion).when(worker).getRuntimeVersion();
Review Comment:
Removed, thank you.
##########
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestWorker.java:
##########
@@ -1026,6 +1029,38 @@ public void testFindNextCompactThrowsTException() throws
Exception {
verify(msc, times(0)).markFailed(any());
}
+ @Test
+ public void testDoesntGatherStatsIfCompactionFails() throws Exception {
+ try (
Review Comment:
Refactored.
Issue Time Tracking
-------------------
Worklog Id: (was: 796916)
Time Spent: 1h 10m (was: 1h)
> Do not collect statistics if the compaction fails
> -------------------------------------------------
>
> Key: HIVE-26407
> URL: https://issues.apache.org/jira/browse/HIVE-26407
> Project: Hive
> Issue Type: Test
> Components: Hive
> Reporter: Zsolt Miskolczi
> Assignee: Zsolt Miskolczi
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> It can still compute statistics, even if compaction fails.
> if (computeStats) \{
> StatsUpdater.gatherStats(ci, conf, runJobAsSelf(ci.runAs) ? ci.runAs :
> t1.getOwner(),
> CompactorUtil.getCompactorJobQueueName(conf, ci, t1));
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)