Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,23 @@ class VeloxTransformerApi extends TransformerApi with Logging {
override def postProcessNativeConfig(
nativeConfMap: JMap[String, String],
backendPrefix: String): Unit = {
// 'spark.hadoop.fs.s3a.connection.timeout' by velox requires time unit, hadoop-aws versions
// before 3.4 do not have time unit.
val s3sConnectionTimeout = nativeConfMap.get("spark.hadoop.fs.s3a.connection.timeout")
if (NumberUtils.isCreatable(s3sConnectionTimeout)) {
nativeConfMap.put("spark.hadoop.fs.s3a.connection.timeout", s"${s3sConnectionTimeout}ms")
// S3A configurations that require time units for Velox.
// Hadoop-aws versions before 3.3.6 do not include time units by default.
Copy link
Contributor

@zml1206 zml1206 Jan 8, 2026

Choose a reason for hiding this comment

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

Why modify it? It should be before version 3.4. Suggestion:
Some configurations in Hadoop-aws versions before 3.4 do not include time units.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my mistake.

// Reference: https://hadoop.apache.org/docs/r3.3.6/hadoop-aws/tools/hadoop-aws/#General_S3A_Client_configuration
val s3aTimeConfigs = Map(
"spark.hadoop.fs.s3a.connection.timeout" -> "ms",
"spark.hadoop.fs.s3a.connection.establish.timeout" -> "ms",
"spark.hadoop.fs.s3a.threads.keepalivetime" -> "s",
"spark.hadoop.fs.s3a.multipart.purge.age" -> "s"
)

s3aTimeConfigs.foreach {
case (configKey, defaultUnit) =>
val configValue = nativeConfMap.get(configKey)
if (configValue != null && NumberUtils.isCreatable(configValue)) {
Copy link
Contributor

@zml1206 zml1206 Jan 9, 2026

Choose a reason for hiding this comment

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

configValue != null is redundant, NumberUtils.isCreatable contains null checks.

// Config is numeric (no unit), append the default unit for backward compatibility
nativeConfMap.put(configKey, s"$configValue$defaultUnit")
}
}
}

Expand Down