wangyum commented on PR #37672:
URL: https://github.com/apache/spark/pull/37672#issuecomment-1230023807
Yes. For example:
```scala
spark.range(1).selectExpr("cast(id as string) as id").write.saveAsTable("t1")
var i = 0
spark.udf.register("testHeavyUdf", (s: String) => {
i = i + 1
System.out.println("testHeavyUdf: " + i)
Thread.sleep(1000)
s
})
spark.sql("select * from t1 where testHeavyUdf(id) like any('%a', 'b%',
'%c%');").collect()
```
Before this PR:
```
testHeavyUdf: 1
testHeavyUdf: 2
testHeavyUdf: 3
```
After this PR:
```
testHeavyUdf: 1
```
--
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]