AngersZhuuuu commented on a change in pull request #30156:
URL: https://github.com/apache/spark/pull/30156#discussion_r512381921
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/BaseScriptTransformationExec.scala
##########
@@ -104,10 +104,16 @@ trait BaseScriptTransformationExec extends UnaryExecNode {
val reader = new BufferedReader(new InputStreamReader(inputStream,
StandardCharsets.UTF_8))
val outputRowFormat =
ioschema.outputRowFormatMap("TOK_TABLEROWFORMATFIELD")
+
+ val padNull = if (conf.legacyPadNullWhenValueLessThenSchema) {
+ (arr: Array[String], size: Int) => arr.padTo(size, null)
+ } else {
+ (arr: Array[String], size: Int) => arr
+ }
Review comment:
pass as a func to avoid repeating this logic
----------------------------------------------------------------
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]