MaxGekk opened a new pull request #27502: [SPARK-30759][SQL] Initialize cache 
for foldable patterns in StringRegexExpression
URL: https://github.com/apache/spark/pull/27502
 
 
   ### What changes were proposed in this pull request?
   In the PR, I propose to fix `cache` initialization in 
`StringRegexExpression` by changing `case Literal(value: String, StringType)` 
to `case p: Expression if p.foldable`
   
   ### Why are the changes needed?
   Actually, the case doesn't work at all because of:
   1. Literals value has type `UTF8String`
   2. It doesn't work for foldable expressions like in the example:
   ```sql
   SELECT '%SystemDrive%\Users\John' _FUNC_ '%SystemDrive%\\Users.*';
   ```
   <img width="649" alt="Screen Shot 2020-02-08 at 22 45 50" 
src="https://user-images.githubusercontent.com/1580697/74091681-0d4a2180-4acb-11ea-8a0d-7e8c65f4214e.png";>
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   ### How was this patch tested?
   By the `check outputs of expression examples` test from `SQLQuerySuite`.

----------------------------------------------------------------
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]

Reply via email to