[
https://issues.apache.org/jira/browse/HIVE-25224?focusedWorklogId=610389&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610389
]
ASF GitHub Bot logged work on HIVE-25224:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Jun/21 07:46
Start Date: 14/Jun/21 07:46
Worklog Time Spent: 10m
Work Description: kasakrisz commented on a change in pull request #2381:
URL: https://github.com/apache/hive/pull/2381#discussion_r649926112
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/BucketVersionPopulator.java
##########
@@ -131,22 +132,47 @@ private OpGroup newGroup(NodeProcessorCtx procCtx) {
}
}
+ enum InfoType {
+ MANDATORY, OPTIONAL,
+ };
+
/**
* This class represents the version required by an Operator.
*/
- private static class OperatorBucketingVersionInfo {
+ static class OperatorBucketingVersionInfo {
+
+ public static final Comparator<OperatorBucketingVersionInfo>
MANDATORY_FIRST =
+ new Comparator<BucketVersionPopulator.OperatorBucketingVersionInfo>() {
+ @Override
+ public int compare(OperatorBucketingVersionInfo i1,
OperatorBucketingVersionInfo i2) {
+ int r = i1.infoType.compareTo(i2.infoType);
+ if (r != 0) {
+ // mandatory first
+ return r;
+ }
+ r = i2.bucketingVersion - i1.bucketingVersion;
Review comment:
nit. `Integer.compare(i2.bucketingVersion, i1.bucketingVersion)` can be
used here.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 610389)
Time Spent: 20m (was: 10m)
> Multi insert statements involving tables with different bucketing_versions
> results in error
> -------------------------------------------------------------------------------------------
>
> Key: HIVE-25224
> URL: https://issues.apache.org/jira/browse/HIVE-25224
> Project: Hive
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> {code}
> drop table if exists t;
> drop table if exists t2;
> drop table if exists t3;
> create table t (a integer);
> create table t2 (a integer);
> create table t3 (a integer);
> alter table t set tblproperties ('bucketing_version'='1');
> explain from t3 insert into t select a insert into t2 select a;
> {code}
> results in
> {code}
> Error: Error while compiling statement: FAILED: RuntimeException Error
> setting bucketingVersion for group: [[op: FS[2], bucketingVersion=1], [op:
> FS[11], bucketingVersion=2]] (state=42000,code=40000)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)