You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/09/22 06:05:03 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #43037: [SPARK-45262][SQL][TESTS][DOCS] Improve examples for `LIKE`

MaxGekk commented on code in PR #43037:
URL: https://github.com/apache/spark/pull/43037#discussion_r1333918575


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/regexpExpressions.scala:
##########
@@ -105,13 +105,15 @@ abstract class StringRegexExpression extends BinaryExpression
     Examples:
       > SELECT _FUNC_('Spark', '_park');
       true
+      > SELECT '\\abc' AS S, S _FUNC_ R'\\abc', S _FUNC_ '\\\\abc';
+      \abc	true	true
       > SET spark.sql.parser.escapedStringLiterals=true;
       spark.sql.parser.escapedStringLiterals	true
       > SELECT '%SystemDrive%\Users\John' _FUNC_ '\%SystemDrive\%\\Users%';
       true
       > SET spark.sql.parser.escapedStringLiterals=false;
       spark.sql.parser.escapedStringLiterals	false
-      > SELECT '%SystemDrive%\\Users\\John' _FUNC_ '\%SystemDrive\%\\\\Users%';

Review Comment:
   > Do we have a doc to explain what the string value we get eventually by writing string literals in SQL?
   
   There is the doc about string literals: https://spark.apache.org/docs/latest/sql-ref-literals.html#string-literal. It explain something implemented in https://github.com/apache/spark/blob/5f643ee1444d41ca78ef397d9675efac550a6967/sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/SparkParserUtils.scala#L34-L54



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org