-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-33212][FOLLOW-UP][BUILD] Bring back duplicate dependency check and add more strict Hadoop version check #31203
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ import org.apache.spark.sql.catalyst.util.quietly | |
| import org.apache.spark.sql.hive.HiveUtils | ||
| import org.apache.spark.sql.internal.NonClosableMutableURLClassLoader | ||
| import org.apache.spark.sql.internal.SQLConf | ||
| import org.apache.spark.util.{MutableURLClassLoader, Utils} | ||
| import org.apache.spark.util.{MutableURLClassLoader, Utils, VersionUtils} | ||
|
|
||
| /** Factory for `IsolatedClientLoader` with specific versions of hive. */ | ||
| private[hive] object IsolatedClientLoader extends Logging { | ||
|
|
@@ -107,12 +107,19 @@ private[hive] object IsolatedClientLoader extends Logging { | |
| s"Please set ${HiveUtils.HIVE_METASTORE_VERSION.key} with a valid version.") | ||
| } | ||
|
|
||
| def supportsHadoopShadedClient(hadoopVersion: String): Boolean = { | ||
| VersionUtils.majorMinorPatchVersion(hadoopVersion).exists { | ||
| case (3, 2, v) if v >= 2 => true | ||
| case _ => false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe Seems like we can reasonably assume that future versions of Hadoop will support the shaded client?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we'd better to wait until the future versions come out before changing this (so that we can verify firs). For instance, Hadoop 3.3.0 currently doesn't support shaded client (due to the hadoop-aws issue). But yeah the Hadoop 3.2.2+ should support the shaded client assuming there's no regression.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting... I just worry about forgetting to update this if/when we bump the Hadoop version in the future and causing a regression. Has the It seems you're more tied into what's happening in the Hadoop world than I am these days so I'll take your word in either direction. If we decide not to future-proof it, can we create a follow-up JIRA to revisit it once some future release is out at which time we would be confident in putting a wildcard?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your concern is valid. One thing we can do is perhaps adding a test to make sure that the built-in Hadoop version is always compatible with the shaded client. So that in future if we upgrade Hadoop version & forget to do this, the test will break.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And yes we can assume that 3.2.2+, 3.3.1+ and 3.4.0+ will all have the fix.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent idea on adding a compatibility test for the built-in Hadoop version!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I agree that we need to change this again.
|
||
| } | ||
| } | ||
|
|
||
| private def downloadVersion( | ||
| version: HiveVersion, | ||
| hadoopVersion: String, | ||
| ivyPath: Option[String], | ||
| remoteRepos: String): Seq[URL] = { | ||
| val hadoopJarNames = if (hadoopVersion.startsWith("3")) { | ||
| val hadoopJarNames = if (supportsHadoopShadedClient(hadoopVersion)) { | ||
| Seq(s"org.apache.hadoop:hadoop-client-api:$hadoopVersion", | ||
| s"org.apache.hadoop:hadoop-client-runtime:$hadoopVersion") | ||
| } else { | ||
|
|
@@ -123,22 +130,14 @@ private[hive] object IsolatedClientLoader extends Logging { | |
| .map(a => s"org.apache.hive:$a:${version.fullVersion}") ++ | ||
| Seq("com.google.guava:guava:14.0.1") ++ hadoopJarNames | ||
|
|
||
| val extraExclusions = if (hadoopVersion.startsWith("3")) { | ||
| // this introduced from lower version of Hive could conflict with jars in Hadoop 3.2+, so | ||
| // exclude here in favor of the ones in Hadoop 3.2+ | ||
| Seq("org.apache.hadoop:hadoop-auth") | ||
| } else { | ||
|
Comment on lines
-126
to
-130
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to exclude hadoop-auth anymore?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Seq.empty | ||
| } | ||
|
|
||
| val classpaths = quietly { | ||
| SparkSubmitUtils.resolveMavenCoordinates( | ||
| hiveArtifacts.mkString(","), | ||
| SparkSubmitUtils.buildIvySettings( | ||
| Some(remoteRepos), | ||
| ivyPath), | ||
| transitive = true, | ||
| exclusions = version.exclusions ++ extraExclusions) | ||
| exclusions = version.exclusions) | ||
| } | ||
| val allFiles = classpaths.map(new File(_)).toSet | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mention that minor/patch versions are filled in as 0 if they're not found. This is different from the behavior of other methods in this class (e.g. majorMinor will give an error if minor is not present)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good point.