Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/18477#discussion_r146653604
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala
---
@@ -268,7 +268,10 @@ case class StringSplit(str: Expression, pattern:
Expression)
usage = "_FUNC_(str, regexp, rep) - Replaces all substrings of `str`
that match `regexp` with `rep`.",
extended = """
Examples:
- > SELECT _FUNC_('100-200', '(\d+)', 'num');
+ spark-sql> SELECT _FUNC_('100-200', '(\\d+)', 'num');
+ num-num
+
+ scala> SELECT _FUNC_('100-200', '(\\\\d+)', 'num');
num-num
--- End diff --
> scala> spark.sql("SELECT regexp_replace('100-200', '(\\\\d+)',
'num')").collect()
> Array([num-num])
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]