Skip to content

HIVE-24553. Exclude calcite from test-jar dependency of hive-exec #1794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2020

Conversation

viirya
Copy link
Member

@viirya viirya commented Dec 18, 2020

What changes were proposed in this pull request?

This patch proposes to exclude calcite dependencies from test-jar dependency of hive-exec.

Why are the changes needed?

The test "org.apache.hive.beeline.cli.TestHiveCli - testSetHeaderValue" we found the exception:

Caused by: java.lang.NoSuchMethodError: org.apache.calcite.rel.RelCollationImpl.<init>(Lorg/apache/hive/com/google/common/collect/ImmutableList;)V
	at org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelCollation.<init>(HiveRelCollation.java:29) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.optimizer.calcite.RelOptHiveTable.getCollationList(RelOptHiveTable.java:181) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.calcite.rel.metadata.RelMdCollation.table(RelMdCollation.java:175) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.rel.metadata.RelMdCollation.collations(RelMdCollation.java:122) ~[calcite-core-1.10.0.jar:1.10.0]
	at GeneratedMetadataHandler_Collation.collations_$(Unknown Source) ~[?:?]
	at GeneratedMetadataHandler_Collation.collations(Unknown Source) ~[?:?]
	at org.apache.calcite.rel.metadata.RelMetadataQuery.collations(RelMetadataQuery.java:482) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.sql2rel.RelFieldTrimmer.trimChild(RelFieldTrimmer.java:189) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.sql2rel.RelFieldTrimmer.trimFields(RelFieldTrimmer.java:374) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRelFieldTrimmer.trimFields(HiveRelFieldTrimmer.java:273) ~[hive-exec-2.3.8.jar:2.3.8]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_262]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_262]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_262]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_262]
	at org.apache.calcite.util.ReflectUtil$2.invoke(ReflectUtil.java:531) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.sql2rel.RelFieldTrimmer.dispatchTrimFields(RelFieldTrimmer.java:270) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.sql2rel.RelFieldTrimmer.trim(RelFieldTrimmer.java:160) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1331) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1261) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.calcite.tools.Frameworks$1.apply(Frameworks.java:113) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:997) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:149) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:106) ~[calcite-core-1.10.0.jar:1.10.0]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1069) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1085) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:364) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11138) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:286) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1295) ~[hive-exec-2.3.8.jar:2.3.8]
	at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:204) ~[hive-service-2.3.8.jar:2.3.8]
	... 50 more

This looks like adding dependency of test-jar of hive-exec pulls in the unshaded calcite dependencies which conflicts with shaded calcite. We should exclude unshaded calcite when adding test-jar of hive-exec.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit test.

@viirya
Copy link
Member Author

viirya commented Dec 18, 2020

@sunchao Looks like "testSetHeaderValue – org.apache.hive.beeline.cli.TestHiveCli" was passed now in CI.

@viirya
Copy link
Member Author

viirya commented Dec 19, 2020

@sunchao Please let me know if you think this is good to merge. I will create a JIRA for this.

Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @viirya ! This looks good to me with one comment. BTW I'm looking at the org.apache.hadoop.hive.cli.TestAccumuloCliDriver being stuck during test and it seems started happening since #1356 (verified locally)

@@ -99,6 +99,20 @@
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as I no longer see the test failure 👍 . BTW do you know why we need to exclude calcite here but not in other places where hive-exec is also used?

Copy link
Member Author

@viirya viirya Dec 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test-jar won't include shaded dependencies. Then un-shaded dependencies will be pull. So I think we need to exclude them.

If there are other places using hive-exec in test scope, I think they might also need to exclude these.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. I think there are a few other places with similar pattern, such as hive-webhcat-java-client. Should we exclude in all those places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I think so. I will update this later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated all hive-exec test-jar usage in all pom.xml files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Can you create a JIRA for this? I'm not sure if master branch also have this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a JIRA. Updated the title and description.

@viirya
Copy link
Member Author

viirya commented Dec 19, 2020

Thanks @viirya ! This looks good to me with one comment. BTW I'm looking at the org.apache.hadoop.hive.cli.TestAccumuloCliDriver being stuck during test and it seems started happening since #1356 (verified locally)

Hmm, okay. Just stuck without any error/exception? Then it seems harder to figure out the reason.

@sunchao
Copy link
Member

sunchao commented Dec 19, 2020

Thanks @viirya ! This looks good to me with one comment. BTW I'm looking at the org.apache.hadoop.hive.cli.TestAccumuloCliDriver being stuck during test and it seems started happening since #1356 (verified locally)

Hmm, okay. Just stuck without any error/exception? Then it seems harder to figure out the reason.

Yes just stuck without any error/exception. Thread dump also doesn't give much information which is interesting.

@sunchao
Copy link
Member

sunchao commented Dec 19, 2020

OK. I tried to bump Accumulo version to 1.7.3 (the one used by master branch) and I got the exception:

select * from accumulo_table_1
[ERROR]   TestAccumuloCliDriver.testCliDriver:59 Unexpected exception java.lang.NoClassDefFoundError: org/eigenbase/util/property/BooleanProperty
        at org.apache.calcite.util.SaffronProperties.<init>(SaffronProperties.java:66)
        at org.apache.calcite.util.SaffronProperties.instance(SaffronProperties.java:134)
        at org.apache.calcite.util.Util.getDefaultCharset(Util.java:769)
        at org.apache.calcite.rel.type.RelDataTypeFactoryImpl.getDefaultCharset(RelDataTypeFactoryImpl.java:565)
        at org.apache.calcite.sql.type.SqlTypeUtil.addCharsetAndCollation(SqlTypeUtil.java:1070)
        at org.apache.calcite.sql.type.SqlTypeFactoryImpl.createSqlType(SqlTypeFactoryImpl.java:65)
        at org.apache.calcite.rex.RexBuilder.<init>(RexBuilder.java:114)
        at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:991)
        at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:149)
        at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:106)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1069)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1085)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:364)
        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11138)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:286)
        at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512)
        at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
        at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)

as in #1792. So perhaps with Accumulo 1.6.0 the exception got swallowed silently and therefore test got stuck. After applying patch there together with the version bump the issue seems gone, but without version bump it will still stuck for unknown reason. I'll update #1792 with this change.

@viirya
Copy link
Member Author

viirya commented Dec 19, 2020

Thanks. @sunchao

@viirya
Copy link
Member Author

viirya commented Dec 19, 2020

OK. I tried to bump Accumulo version to 1.7.3 (the one used by master branch) and I got the exception:

select * from accumulo_table_1
[ERROR]   TestAccumuloCliDriver.testCliDriver:59 Unexpected exception java.lang.NoClassDefFoundError: org/eigenbase/util/property/BooleanProperty
        at org.apache.calcite.util.SaffronProperties.<init>(SaffronProperties.java:66)
        at org.apache.calcite.util.SaffronProperties.instance(SaffronProperties.java:134)
        at org.apache.calcite.util.Util.getDefaultCharset(Util.java:769)
        at org.apache.calcite.rel.type.RelDataTypeFactoryImpl.getDefaultCharset(RelDataTypeFactoryImpl.java:565)
        at org.apache.calcite.sql.type.SqlTypeUtil.addCharsetAndCollation(SqlTypeUtil.java:1070)
        at org.apache.calcite.sql.type.SqlTypeFactoryImpl.createSqlType(SqlTypeFactoryImpl.java:65)
        at org.apache.calcite.rex.RexBuilder.<init>(RexBuilder.java:114)
        at org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:991)
        at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:149)
        at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:106)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1069)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1085)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:364)
        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11138)
        at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:286)
        at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512)
        at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
        at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)

as in #1792. So perhaps with Accumulo 1.6.0 the exception got swallowed silently and therefore test got stuck. After applying patch there together with the version bump the issue seems gone, but without version bump it will still stuck for unknown reason. I'll update #1792 with this change.

So sounds like the stuck seems related to Accumulo version?

@sunchao
Copy link
Member

sunchao commented Dec 19, 2020

Yes seems so although I don't know the exact reason yet. There is also another JIRA mentioning a similar test stuck issue when upgrading Accumulo from 1.7.3 to 1.8.0

@viirya viirya changed the title [DO-NOT-MERGE] Test exclude calcite in beeline HIVE-24553. Exclude calcite from test-jar dependency of hive-exec Dec 20, 2020
Copy link
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will merge shortly.

@sunchao sunchao merged commit d7caeaf into apache:branch-2.3 Dec 21, 2020
@viirya
Copy link
Member Author

viirya commented Dec 21, 2020

Thanks @sunchao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants