Skip to content

Commit e854b10

Browse files
committed
Also update doc for Like expression.
1 parent c81f030 commit e854b10

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ abstract class StringRegexExpression extends BinaryExpression
8686
escape character, the following character is matched literally. It is invalid to escape
8787
any other character.
8888
89+
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".
91+
92+
When SQL config 'spark.sql.parser.escapedStringLiterals' is enabled, it fallbacks
93+
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".
95+
8996
Examples:
9097
> SELECT '%SystemDrive%\Users\John' _FUNC_ '\%SystemDrive\%\\Users%'
9198
true

0 commit comments

Comments
 (0)