AngersZhuuuu opened a new pull request #34761:
URL: https://github.com/apache/spark/pull/34761


   ### What changes were proposed in this pull request?
   Add `CONTAINS` string function.
   
   | function| arguments | Returns |
   |-------|-------|-------|
   | CONTAINS( left , right) | left: String, right: String | Returns a BOOLEAN. 
The value is True if right is found inside left. Returns NULL if either input 
expression is NULL. Otherwise, returns False.|
   
   
   ### Why are the changes needed?
   contains() is a common convenient function supported by a number of database 
systems:
   
   - 
https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#contains_substr
   - https://docs.snowflake.com/en/_static/apple-touch-icon.png!CONTAINS — 
Snowflake Documentation
   
   Support it in Spark SQL function.
   
   ### Does this PR introduce _any_ user-facing change?
   User can use `contains(left, right)`:
   
   | Left   |      Right      |  Return |
   |----------|:-------------:|------:|
   | null |  "Spark SQL" | null |
   | "Spark SQL" |  null | null |
   | null |  null | null |
   | "Spark SQL" |  "Spark" | true |
   | "Spark SQL" |  "k SQL" | true |
   | "Spark SQL" | "SPARK" | false |
   
   ### 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]

Reply via email to