dongjoon-hyun commented on code in PR #38084:
URL: https://github.com/apache/spark/pull/38084#discussion_r990387422
##########
core/src/test/scala/org/apache/spark/deploy/SparkHadoopUtilSuite.scala:
##########
@@ -80,17 +87,100 @@ class SparkHadoopUtilSuite extends SparkFunSuite {
assertConfigValue(hadoopConf, "fs.s3a.endpoint", null)
}
+ /**
+ * spark.hive.* is passed to the hadoop config as hive.*.
+ */
+ test("spark.hive propagation") {
+ val sc = new SparkConf()
+ val hadoopConf = new Configuration(false)
+ sc.set("spark.hive.hiveoption", "value")
+ new SparkHadoopUtil().appendS3AndSparkHadoopHiveConfigurations(sc,
hadoopConf)
+ assertConfigMatches(hadoopConf, "hive.hiveoption", "value",
+ SOURCE_SPARK_HIVE)
+ }
+
+ /**
+ * The explicit buffer size propagation records this.
+ */
+ test("SPARK-40640: buffer size propagation") {
+ val sc = new SparkConf()
+ val hadoopConf = new Configuration(false)
+ sc.set(BUFFER_SIZE.key, "123")
+ new SparkHadoopUtil().appendS3AndSparkHadoopHiveConfigurations(sc,
hadoopConf)
+ assertConfigMatches(hadoopConf, "io.file.buffer.size", "123",
BUFFER_SIZE.key)
+ }
+
+ test("SPARK-40640: aws credentials from environment variables") {
+ val env = new java.util.HashMap[String, String]
+ env.put(ENV_VAR_AWS_ACCESS_KEY, "access-key")
+ env.put(ENV_VAR_AWS_SECRET_KEY, "secret-key")
+ env.put(ENV_VAR_AWS_SESSION_TOKEN, "session-token")
+ val hadoopConf = new Configuration(false)
+ SparkHadoopUtil.appendS3CredentialsFromEnvironment(hadoopConf, env)
+ val source = "Set by Spark on " + InetAddress.getLocalHost + " from "
+ assertConfigMatches(hadoopConf, "fs.s3a.access.key", "access-key", source)
+ assertConfigMatches(hadoopConf, "fs.s3a.secret.key", "secret-key", source)
+ assertConfigMatches(hadoopConf, "fs.s3a.session.token", "session-token",
source)
+ }
+
+ test("SPARK-19739: S3 session token propagation requires access and secret
keys") {
Review Comment:
I understand what you mean, but you should not add irrelevant test cover in
this PR. You don't use `assertConfigMatches` or `assertConfigSourceContains`
here. So, it looks like completely independent test case. Please proceed this
as a separate test case PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]