AngersZhuuuu opened a new pull request #34848:
URL: https://github.com/apache/spark/pull/34848
### What changes were proposed in this pull request?
In current realization, `contains`, `startsWith` and `endsWith` only support
StringType as input, in this pr, we make these three string function support
binary too.
### Why are the changes needed?
Make function `contains`, `startsWith`, `endsWith` support BinaryType
### Does this PR introduce _any_ user-facing change?
user can use binary as input.
expression | result
-- | --
contains(encode('Spark SQL', 'utf-8'), 'Spark') | true
startsWith(encode('Spark SQL', 'utf-8'), 'Spark') | true
contains(encode('Spark SQL', 'utf-8'), 'SparkSQL') | false
endsWith(encode('Spark SQL', 'utf-8'), 'Spark') | false
endsWith(encode('Spark SQL', 'utf-8'), 'SQL') | true
### How was this patch tested?
added UT
--
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]