AngersZhuuuu commented on a change in pull request #33363:
URL: https://github.com/apache/spark/pull/33363#discussion_r674469954



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/BaseScriptTransformationExec.scala
##########
@@ -118,7 +118,7 @@ trait BaseScriptTransformationExec extends UnaryExecNode {
       val processRowWithoutSerde = if (!ioschema.schemaLess) {
         prevLine: String =>
           new GenericInternalRow(
-            prevLine.split(outputRowFormat).padTo(outputFieldWriters.size, 
null)
+            prevLine.split(outputRowFormat, -1).padTo(outputFieldWriters.size, 
null)

Review comment:
       FYI @cloud-fan @maropu For this change, I need to explain is that. 
   If we not add parameter -1, 
   ```
   "2@false@Spark SQL@".split('@') will have three elems
   "2"
   "false"
   "Spark SQL"
   ```
   Since we are strict handle data, we need to add -1 the result should be 
   ```
   "2@false@Spark SQL@".split('@', -1) will have three elems
   "2"
   "false"
   "Spark SQL"
   ""
   ```




-- 
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]

Reply via email to