-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-35102][SQL] Make spark.sql.hive.version read-only, not deprecated and meaningful #32200
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit | |
|
||
import scala.collection.JavaConverters._ | ||
import scala.collection.mutable.HashMap | ||
import scala.util.Try | ||
|
||
import org.apache.commons.lang3.{JavaVersion, SystemUtils} | ||
import org.apache.hadoop.conf.Configuration | ||
|
@@ -53,22 +54,30 @@ private[spark] object HiveUtils extends Logging { | |
/** The version of hive used internally by Spark SQL. */ | ||
val builtinHiveVersion: String = HiveVersionInfo.getVersion | ||
|
||
val BUILTIN_HIVE_VERSION = buildStaticConf("spark.sql.hive.version") | ||
.doc("The compiled, a.k.a, builtin Hive version of the Spark distribution bundled with." + | ||
" Note that, this a read-only conf and only used to report the built-in hive version." + | ||
" If you want a different metastore client for Spark to call, please refer to" + | ||
" spark.sql.hive.metastore.version.") | ||
.version("1.1.1") | ||
.stringConf | ||
.checkValue(_ == builtinHiveVersion, | ||
"The builtin Hive version is read-only, please use spark.sql.hive.metastore.version") | ||
.createWithDefault(builtinHiveVersion) | ||
|
||
private def isCompatibleHiveVersion(hiveVersionStr: String): Boolean = { | ||
Try { IsolatedClientLoader.hiveVersion(hiveVersionStr) }.isSuccess | ||
} | ||
|
||
val HIVE_METASTORE_VERSION = buildStaticConf("spark.sql.hive.metastore.version") | ||
.doc("Version of the Hive metastore. Available options are " + | ||
"<code>0.12.0</code> through <code>2.3.8</code> and " + | ||
"<code>3.0.0</code> through <code>3.1.2</code>.") | ||
.version("1.4.0") | ||
.stringConf | ||
.checkValue(isCompatibleHiveVersion, "Unsupported Hive Metastore version") | ||
.createWithDefault(builtinHiveVersion) | ||
|
||
// A fake config which is only here for backward compatibility reasons. This config has no effect | ||
// to Spark, just for reporting the builtin Hive version of Spark to existing applications that | ||
// already rely on this config. | ||
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. We don't need to keep this comment above? 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. Yes, it's out of date and the new document of the config is more detailed and specific. |
||
val FAKE_HIVE_VERSION = buildConf("spark.sql.hive.version") | ||
.doc(s"deprecated, please use ${HIVE_METASTORE_VERSION.key} to get the Hive version in Spark.") | ||
.version("1.1.1") | ||
.fallbackConf(HIVE_METASTORE_VERSION) | ||
|
||
val HIVE_METASTORE_JARS = buildStaticConf("spark.sql.hive.metastore.jars") | ||
.doc(s""" | ||
| Location of the jars that should be used to instantiate the HiveMetastoreClient. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
do we need to set it here? it's read-only now.
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.
This looks like another problem at the read-side that we need to look into. this PR just change it to read-only but still need to explicitly set the default value like before (https://github.com/apache/spark/pull/32200/files#diff-d6fa3cebb959651e721093f193f2c3b7197d7d0d1c503e34860aa048164b6b0eL66 and https://github.com/apache/spark/pull/32200/files#diff-4ade9276f3d22d5c47a42e1cd96dd6125e8ecc7d38e3f5f6841b8109936463b4L67). Otherwise, the existing and newly added tests would fail to get it.