[
https://issues.apache.org/jira/browse/HIVE-25792?focusedWorklogId=695664&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-695664
]
ASF GitHub Bot logged work on HIVE-25792:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Dec/21 11:55
Start Date: 14/Dec/21 11:55
Worklog Time Spent: 10m
Work Description: pvary commented on a change in pull request #2865:
URL: https://github.com/apache/hive/pull/2865#discussion_r768591706
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/reexec/ReExecDriver.java
##########
@@ -167,20 +201,25 @@ public CommandProcessorResponse run() throws
CommandProcessorException {
}
PlanMapper oldPlanMapper = coreDriver.getPlanMapper();
- afterExecute(oldPlanMapper, cpr != null);
+ final boolean success = cpr != null;
+ plugins.forEach(p -> p.afterExecute(oldPlanMapper, success));
+
+ // If the execution was successful return the result
+ if (success) {
+ return cpr;
+ }
boolean shouldReExecute = explainReOptimization && executionIndex==1;
- shouldReExecute |= cpr == null && shouldReExecute();
+ shouldReExecute |= plugins.stream().anyMatch(p ->
p.shouldReExecute(executionIndex));
- if (executionIndex >= maxExecutuions || !shouldReExecute) {
- if (cpr != null) {
- return cpr;
- } else {
- throw cpe;
- }
+ if (executionIndex >= maxExecutions || !shouldReExecute) {
+ // If we do not have to reexecute, return the last error
+ throw cpe;
}
+
LOG.info("Preparing to re-execute query");
- prepareToReExecute();
+ plugins.forEach(IReExecutionPlugin::prepareToReExecute);
Review comment:
As discussed, most of them was just a loop, so I would keep this instead
of having 6 methods for loops
--
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: 695664)
Time Spent: 2h (was: 1h 50m)
> Multi Insert query fails on CBO path
> -------------------------------------
>
> Key: HIVE-25792
> URL: https://issues.apache.org/jira/browse/HIVE-25792
> Project: Hive
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Peter Vary
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2h
> Remaining Estimate: 0h
>
> {code}
> set hive.cbo.enable=true;
> drop table if exists aa1;
> drop table if exists bb1;
> drop table if exists cc1;
> drop table if exists dd1;
> drop table if exists ee1;
> drop table if exists ff1;
> create table aa1 ( stf_id string);
> create table bb1 ( stf_id string);
> create table cc1 ( stf_id string);
> create table ff1 ( x string);
> explain
> from ff1 as a join cc1 as b
> insert overwrite table aa1 select stf_id GROUP BY b.stf_id
> insert overwrite table bb1 select b.stf_id GROUP BY b.stf_id
> ;
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)