Skip to content

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

a followup of #19712 , adds back the spark.sql.hive.version, so that if users try to read this config, they can still get a default value instead of null.

How was this patch tested?

N/A

@cloud-fan
Copy link
Contributor Author

cc @gatorsmile @yaooqinn

@gatorsmile
Copy link
Member

Add back the test cases?

@cloud-fan
Copy link
Contributor Author

reverted HiveThriftServer2Suites.scala from #19712

@SparkQA
Copy link

SparkQA commented Nov 10, 2017

Test build #83706 has finished for PR 19719 at commit dd1e344.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 10, 2017

Test build #83708 has finished for PR 19719 at commit 0ce241d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 10, 2017

Test build #83705 has finished for PR 19719 at commit 7b767bf.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

conf += resultSet.getString(1) -> resultSet.getString(2)
}

assert(conf.get("spark.sql.hive.version") === Some("1.2.1"))
Copy link
Member

Choose a reason for hiding this comment

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

If we do not set it explicitly, this will not be returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a default value will be returned, isn't it?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, I think. Try it.

Copy link
Member

@yaooqinn yaooqinn Nov 11, 2017

Choose a reason for hiding this comment

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

In Hive, "SET" returns all changed properties while "SET -v" returns all properties. In Spark, SET queries all key-value pairs that are set in the SQLConf of the sparkSession.

@@ -66,6 +66,12 @@ private[spark] object HiveUtils extends Logging {
.stringConf
.createWithDefault(builtinHiveVersion)

// A deprecated config which is only used to provide a default value, in case some existing
// applications depend on this config, e.g. Spark SQL ODBC driver.
val HIVE_EXECUTION_VERSION = buildConf("spark.sql.hive.version")
Copy link
Member

Choose a reason for hiding this comment

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

doc may needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This config is a kind of a fake one, I think comments are enough for it.

Copy link
Member

Choose a reason for hiding this comment

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

or maybe more meaningful name

@@ -66,6 +66,12 @@ private[spark] object HiveUtils extends Logging {
.stringConf
.createWithDefault(builtinHiveVersion)

// A deprecated config which is only used to provide a default value, in case some existing
// applications depend on this config, e.g. Spark SQL ODBC driver.
Copy link
Member

@yaooqinn yaooqinn Nov 11, 2017

Choose a reason for hiding this comment

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

i guess the jdbc driver do not depend on it. it used to only return 1.2.1, i can't imagine it a meaningful value, and i think that jdbc server may work fine with other hive versions too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's ODBC. Actually it's something out of Spark's control, we must be careful and avoid behavior changes, like conf.get("spark.sql.hive.version") should still return 1.2.1 instead of null.

Copy link
Member

Choose a reason for hiding this comment

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

if Thrift Server only works for 1.2.1,I guess we don’t need an isolated classload for its hive client like SparkSQLCLIDriver

@yaooqinn
Copy link
Member

make it an AlternativeConfig maybe better

@SparkQA
Copy link

SparkQA commented Nov 11, 2017

Test build #83712 has finished for PR 19719 at commit 28fab02.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -55,6 +55,7 @@ private[hive] object SparkSQLEnv extends Logging {
metadataHive.setOut(new PrintStream(System.out, true, "UTF-8"))
metadataHive.setInfo(new PrintStream(System.err, true, "UTF-8"))
metadataHive.setError(new PrintStream(System.err, true, "UTF-8"))
sparkSession.conf.set(HiveUtils.HIVE_EXECUTION_VERSION, HiveUtils.builtinHiveVersion)
Copy link
Member

Choose a reason for hiding this comment

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

HiveUtils.builtinHiveVersion => HiveUtils.HIVE_EXECUTION_VERSION?

}
}

test("Checks Hive version via SET") {
Copy link
Member

Choose a reason for hiding this comment

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

i might be a session level conf

@SparkQA
Copy link

SparkQA commented Nov 11, 2017

Test build #83713 has finished for PR 19719 at commit 42d05a7.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 11, 2017

Test build #83723 has finished for PR 19719 at commit e37c1a8.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 11, 2017

Test build #83732 has finished for PR 19719 at commit eb3137b.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 12, 2017

Test build #83733 has finished for PR 19719 at commit 2088d6b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -66,6 +66,14 @@ private[spark] object HiveUtils extends Logging {
.stringConf
.createWithDefault(builtinHiveVersion)

// A fake config which is only here for backward compatibility reasons. This config has no affect
Copy link
Member

Choose a reason for hiding this comment

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

affect -> effect

@@ -66,6 +66,14 @@ private[spark] object HiveUtils extends Logging {
.stringConf
.createWithDefault(builtinHiveVersion)

// A fake config which is only here for backward compatibility reasons. This config has no affect
// to Spark, just for reporting the builtin Hive version of Spark to existing applications that
// already reply on this config.
Copy link
Member

Choose a reason for hiding this comment

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

reply -> rely

@gatorsmile
Copy link
Member

@gatorsmile
Copy link
Member

LGTM except a few comments

@yaooqinn
Copy link
Member

LGTM

@cloud-fan
Copy link
Contributor Author

Looking at SQLConf.Deprecated.MAPRED_REDUCE_TASKS, it needs to change many places, I don't think it worth for this config.

@SparkQA
Copy link

SparkQA commented Nov 12, 2017

Test build #83748 has finished for PR 19719 at commit b172ce9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member

Thanks! Merged to master.

@asfgit asfgit closed this in f7534b3 Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants