HyukjinKwon commented on a change in pull request #27788: [SPARK-31036][SQL]
Use stringArgs in Expression.toString to respect hidden parameters
URL: https://github.com/apache/spark/pull/27788#discussion_r388202220
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
##########
@@ -533,6 +533,8 @@ case class ArrayExists(
SQLConf.get.getConf(SQLConf.LEGACY_ARRAY_EXISTS_FOLLOWS_THREE_VALUED_LOGIC))
}
+ override def stringArgs: Iterator[Any] = super.stringArgs.take(2)
+
Review comment:
This is actually a followup of https://github.com/apache/spark/pull/27655. I
am not going to add a test case because we don't guarantee on the naming
against `NonSQLExpression` yet. It is just to make it prettier.
I manually tested as below:
```scala
val identify = udf((input: Boolean) => input)
spark.range(10).select(identify(exists(array(col("id")), _ % 2 ===
0))).show()
```
Before:
```
+-------------------------------------------------------------------------------------+
|UDF(exists(array(id), lambdafunction(((lambda 'x % 2) = 0), lambda 'x,
false), true))|
+-------------------------------------------------------------------------------------+
|
true|
|
false|
|
true|
...
```
After:
```
+-------------------------------------------------------------------------------+
|UDF(exists(array(id), lambdafunction(((lambda 'x % 2) = 0), lambda 'x,
false)))|
+-------------------------------------------------------------------------------+
|
true|
|
false|
|
true|
```
Here, now we hide properly `followThreeValuedLogic` in `ArrayExists`.
----------------------------------------------------------------
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]