GitHub user priyankagargnitk opened a pull request:
https://github.com/apache/spark/pull/15294
[SPARK-17619][SQL] To add support for pattern matching in ArrayContains
expression
## What changes were proposed in this pull request?
This change adds support for pattern matching in arrayContains expression
for the string arrays.
For eg.
a. arrayContains ( Seq ( â\\d\\d\\s-\\s\\d\\dâ, null, "",
"pattern"), "12 - 20" ) returns true
b. arrayContains ( Seq ( "\\d\\d\\s-\\s\\d\\d", "", "pattern"),
"132 - 20" ) ) returns false
c. arrayContains ( Seq ( "\\d\\d\\s-\\s\\d\\d", null, ââ,
"pattern"), "132 - 20" ) ) returns null
This change is completely backward compatible.
## How was this patch tested?
Added some more test cases for pattern match use case in the following:
a. CollectionFunctionsSuite.scala
b. DataFrameFunctionsSuite.scala
c. ExpressionToSQLSuite.scala
jira entry for detail: https://issues.apache.org/jira/browse/SPARK-17619
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/priyankagargnitk/spark
array_contains_with_pattern_match
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15294.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15294
----
commit 69f63092ddcb04ea10186d71d407b4886dea3245
Author: Priyanka Garg <[email protected]>
Date: 2016-09-29T08:13:08Z
[SPARK-17619][SQL] To add support for pattern matching in ArrayContains
Expression.
## What changes were proposed in this pull request?
This change adds support for pattern matching in arrayContains expression
for the string arrays.
For eg.
a. arrayContains ( Seq ( â\\d\\d\\s-\\s\\d\\dâ, null, "",
"pattern"), "12 - 20" ) returns true
b. arrayContains ( Seq ( "\\d\\d\\s-\\s\\d\\d", "", "pattern"),
"132 - 20" ) ) returns false
c. arrayContains ( Seq ( "\\d\\d\\s-\\s\\d\\d", null, ââ,
"pattern"), "132 - 20" ) ) returns null
This change is completely backward compatible.
## How was this patch tested?
Added some more test cases for pattern match use case in the following:
a. CollectionFunctionsSuite.scala
b. DataFrameFunctionsSuite.scala
c. ExpressionToSQLSuite.scala
jira entry for detail: https://issues.apache.org/jira/browse/SPARK-17619
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]