Commit 41df62c
[SPARK-16514][SQL] Fix various regex codegen bugs
## What changes were proposed in this pull request?
RegexExtract and RegexReplace currently crash on non-nullable input due use of a hard-coded local variable name (e.g. compiles fail with `java.lang.Exception: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 85, Column 26: Redefinition of local variable "m" `).
This changes those variables to use fresh names, and also in a few other places.
## How was this patch tested?
Unit tests. rxin
Author: Eric Liang <ekl@databricks.com>
Closes #14168 from ericl/sc-3906.
(cherry picked from commit 1c58fa9)
Signed-off-by: Reynold Xin <rxin@databricks.com>1 parent 4303d29 commit 41df62c
File tree
2 files changed
+39
-15
lines changed- sql/catalyst/src
- main/scala/org/apache/spark/sql/catalyst/expressions
- test/scala/org/apache/spark/sql/catalyst/expressions
2 files changed
+39
-15
lines changedLines changed: 33 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
160 | 162 | | |
161 | 163 | | |
162 | | - | |
163 | | - | |
| 164 | + | |
| 165 | + | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| |||
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| 264 | + | |
| 265 | + | |
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
| |||
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| |||
280 | 290 | | |
281 | 291 | | |
282 | 292 | | |
283 | | - | |
| 293 | + | |
284 | 294 | | |
285 | | - | |
286 | | - | |
| 295 | + | |
| 296 | + | |
287 | 297 | | |
288 | | - | |
| 298 | + | |
289 | 299 | | |
290 | | - | |
| 300 | + | |
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
| |||
334 | 344 | | |
335 | 345 | | |
336 | 346 | | |
| 347 | + | |
| 348 | + | |
337 | 349 | | |
338 | 350 | | |
339 | 351 | | |
340 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
341 | 359 | | |
342 | 360 | | |
343 | 361 | | |
344 | 362 | | |
345 | 363 | | |
346 | 364 | | |
347 | 365 | | |
348 | | - | |
| 366 | + | |
349 | 367 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
354 | 372 | | |
355 | 373 | | |
356 | | - | |
| 374 | + | |
357 | 375 | | |
358 | 376 | | |
359 | 377 | | |
| |||
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/StringExpressionsSuite.scala
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
| |||
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
| |||
0 commit comments