Commit 72ce64e
[SPARK-52817][SQL] Fix
### What changes were proposed in this pull request?
Make contains function to be used in like expression with multiple '%'.
### Why are the changes needed?
In some customers' cases , user sometimes use multiple '%' for like expression.
For Example:
```
SELECT * FROM testData where value not like '%%HotFocus%%'
SELECT * FROM testData where value not like '%%%HotFocus%%%'
```
In these SQL queries, cannot convert Like expressions to contains function in logical planning. So the performance is very poor.
### How was this patch tested?
Added UTs and Existed UTs
Closes #51510 from zhixingheyi-tian/fix-like.
Authored-by: zhixingheyi-tian <[email protected]>
Signed-off-by: Yuming Wang <[email protected]>Like Expression performance1 parent 7cc2896 commit 72ce64e
File tree
2 files changed
+53
-4
lines changed- sql/catalyst/src
- main/scala/org/apache/spark/sql/catalyst/optimizer
- test/scala/org/apache/spark/sql/catalyst/optimizer
2 files changed
+53
-4
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
750 | 751 | | |
751 | 752 | | |
752 | 753 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
168 | 216 | | |
169 | 217 | | |
170 | 218 | | |
| |||
0 commit comments