Skip to content

Commit

Permalink
Fix doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed May 11, 2017
1 parent e854b10 commit d8cd670
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ case class Like(left: Expression, right: Expression) extends StringRegexExpressi
regexp - a string expression. The pattern string should be a Java regular expression.
Since Spark 2.0, string literals (including regex patterns) are unescaped in our SQL parser.
For example, if the `str` parameter is "abc\td", the `regexp` can match it is:
"^abc\\\\td$".
For example, if to match "abc\td", a regular expression for `regexp` can be "^abc\\\\td$".
There is a SQL config 'spark.sql.parser.escapedStringLiterals' that can be used to fallback
to the Spark 1.6 behavior regarding string literal parsing. For example, if the config is
enabled, the `regexp` that can match "abc\td" is "^abc\\t$".
Examples:
When spark.sql.parser.escapedStringLiterals is disabled (default).
> SELECT '%SystemDrive%\Users\John' _FUNC_ '%SystemDrive%\\Users.*'
true
There is a SQL config 'spark.sql.parser.escapedStringLiterals' can be used to fallback
to Spark 1.6 behavior regarding string literal parsing. For example, if the config is
enabled, the `regexp` can match "abc\td" is "^abc\\t$".
Examples (spark.sql.parser.escapedStringLiterals is enabled):
When spark.sql.parser.escapedStringLiterals is enabled.
> SELECT '%SystemDrive%\Users\John' _FUNC_ '%SystemDrive%\Users.*'
true
Expand Down

0 comments on commit d8cd670

Please sign in to comment.