[ 
https://issues.apache.org/jira/browse/SPARK-27679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Achuth Narayan Rajagopal updated SPARK-27679:
---------------------------------------------
    Description: 
The following improvements are possible when simplifying {{LIKE}} expressions 
by adding support for underscore case optimization similar to '%' :

{{ Filter name#10 LIKE _abc → Filter (length(name#10) = 4 && EndsWith(name#10, 
abc))}}

{{Filter name#10 LIKE abc_ → Filter (length(name#10) = 4 && StartsWith(name#10, 
abc))}}

{{Filter name#10 LIKE abc_def -> Filter ((length(name#10) = 7) && 
(StartsWith(name#10, abc) && EndsWith(name#10, def))) }}

  was:
The following improvements are possible when simplifying `LIKE` expressions -
 # In the case where pattern is `null` replace like expression with 
Literal(`false`), so in cases where applicable we can replace the underlying 
relation with `LocalRelation <empty>`.
 # Add support for underscore case optimization similar to '%'.


> Improve queries with LIKE expression
> ------------------------------------
>
>                 Key: SPARK-27679
>                 URL: https://issues.apache.org/jira/browse/SPARK-27679
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.3
>            Reporter: Achuth Narayan Rajagopal
>            Priority: Major
>
> The following improvements are possible when simplifying {{LIKE}} expressions 
> by adding support for underscore case optimization similar to '%' :
> {{ Filter name#10 LIKE _abc → Filter (length(name#10) = 4 && 
> EndsWith(name#10, abc))}}
> {{Filter name#10 LIKE abc_ → Filter (length(name#10) = 4 && 
> StartsWith(name#10, abc))}}
> {{Filter name#10 LIKE abc_def -> Filter ((length(name#10) = 7) && 
> (StartsWith(name#10, abc) && EndsWith(name#10, def))) }}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to