Skip to content

Commit 753f115

Browse files
committed
[SPARK-21261][DOCS][SQL] SQL Regex document fix
## What changes were proposed in this pull request? Fix regexes in spark-sql command examples. This takes over #18477 ## How was this patch tested? Existing tests. I verified the existing example doesn't work in spark-sql, but new ones does. Author: Sean Owen <[email protected]> Closes #21808 from srowen/SPARK-21261.
1 parent d404e54 commit 753f115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ case class StringSplit(str: Expression, pattern: Expression)
272272
usage = "_FUNC_(str, regexp, rep) - Replaces all substrings of `str` that match `regexp` with `rep`.",
273273
examples = """
274274
Examples:
275-
> SELECT _FUNC_('100-200', '(\d+)', 'num');
275+
> SELECT _FUNC_('100-200', '(\\d+)', 'num');
276276
num-num
277277
""")
278278
// scalastyle:on line.size.limit
@@ -371,7 +371,7 @@ case class RegExpReplace(subject: Expression, regexp: Expression, rep: Expressio
371371
usage = "_FUNC_(str, regexp[, idx]) - Extracts a group that matches `regexp`.",
372372
examples = """
373373
Examples:
374-
> SELECT _FUNC_('100-200', '(\d+)-(\d+)', 1);
374+
> SELECT _FUNC_('100-200', '(\\d+)-(\\d+)', 1);
375375
100
376376
""")
377377
case class RegExpExtract(subject: Expression, regexp: Expression, idx: Expression)

0 commit comments

Comments
 (0)