Skip to content

Commit 8ecb2ea

Browse files
committed
Change java string literal to SQL shell string.
1 parent d8cd670 commit 8ecb2ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ abstract class StringRegexExpression extends BinaryExpression
8787
any other character.
8888
8989
Since Spark 2.0, string literals are unescaped in our SQL parser. For example, in order
90-
to match a Tab character "\t", the pattern should be "\\t".
90+
to match "\abc", the pattern should be "\\abc".
9191
9292
When SQL config 'spark.sql.parser.escapedStringLiterals' is enabled, it fallbacks
9393
to Spark 1.6 behavior regarding string literal parsing. For example, if the config is
94-
enabled, the pattern to match a Tab character should be "\t".
94+
enabled, the pattern to match "\abc" should be "\abc".
9595
9696
Examples:
9797
> SELECT '%SystemDrive%\Users\John' _FUNC_ '\%SystemDrive\%\\Users%'
@@ -158,11 +158,11 @@ case class Like(left: Expression, right: Expression) extends StringRegexExpressi
158158
regexp - a string expression. The pattern string should be a Java regular expression.
159159
160160
Since Spark 2.0, string literals (including regex patterns) are unescaped in our SQL parser.
161-
For example, if to match "abc\td", a regular expression for `regexp` can be "^abc\\\\td$".
161+
For example, if to match "\abc", a regular expression for `regexp` can be "^\\abc$".
162162
163163
There is a SQL config 'spark.sql.parser.escapedStringLiterals' that can be used to fallback
164164
to the Spark 1.6 behavior regarding string literal parsing. For example, if the config is
165-
enabled, the `regexp` that can match "abc\td" is "^abc\\t$".
165+
enabled, the `regexp` that can match "\abc" is "^\abc$".
166166
167167
Examples:
168168
When spark.sql.parser.escapedStringLiterals is disabled (default).

0 commit comments

Comments
 (0)