HyukjinKwon opened a new pull request #27788: [WIP][SPARK-31036][SQL] Use 
stringArgs in Expression.toString to respect hidden parameters
URL: https://github.com/apache/spark/pull/27788
 
 
   ### What changes were proposed in this pull request?
   
   This PR proposes to respect hidden parameters by using `stringArgs`  in 
`Expression.toString `. By this, we can show the strings properly in some cases 
such as `NonSQLExpression`.
   
   ### Why are the changes needed?
   
   To respect "hidden" arguments in the string representation.
   
   ### Does this PR introduce any user-facing change?
   
   Yes, for example, on the top of https://github.com/apache/spark/pull/27657, 
   
   ```scala
   val identify = udf((input: Seq[Int]) => input)
   spark.range(10).select(identify(array("id"))).show()
   ```
   
   shows hidden parameter `useStringTypeWhenEmpty`.
   
   ```
   +---------------------+
   |UDF(array(id, false))|
   +---------------------+
   |                  [0]|
   |                  [1]|
   ...
   ```
   
   whereas:
   
   ```scala
   spark.range(10).select(array("id")).show()
   ```
   
   ```
   +---------+
   |array(id)|
   +---------+
   |      [0]|
   |      [1]|
   ...
   ```
   
   ### How was this patch tested?
   
   By existing tests.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to