yaooqinn commented on a change in pull request #32144:
URL: https://github.com/apache/spark/pull/32144#discussion_r613153508
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -1069,6 +1069,21 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
spark.sessionState.conf.clear()
}
+ test("SPARK-35044: SET command shall display default value for hadoop conf
correctly") {
+ val key = "hadoop.this.is.a.test.key"
+ val value = "2018-11-17 13:33:33.333"
+ // these keys are located at `src/test/resources/hive-site.xml`
+ checkAnswer(sql(s"SET $key"), Row(key, value))
+ checkAnswer(sql("SET hadoop.tmp.dir"), Row("hadoop.tmp.dir",
"/tmp/hive_one"))
+
+ // this key does not exist
+ checkAnswer(sql(s"SET ${key}no"), Row(key + "no", "<undefined>"))
+ checkAnswer(sql("SET dfs.replication"), Row("dfs.replication",
"<undefined>"))
+
+ // io.file.buffer.size has a default value from
`SparkHadoopUtil.newConfiguration`
+ checkAnswer(sql("SET io.file.buffer.size"), Row("io.file.buffer.size",
"65536"))
Review comment:
w/o the patch
```scala
spark-sql> SET io.file.buffer.size;
io.file.buffer.size <undefined>
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]