hequn8128 commented on a change in pull request #6671: [FLINK-10281] [table] 
Fix string literal parsing in Table API
URL: https://github.com/apache/flink/pull/6671#discussion_r216206820
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
 ##########
 @@ -185,13 +185,18 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
           }
       }
 
-  lazy val singleQuoteStringLiteral: Parser[Expression] =
-    ("'" + """([^'\p{Cntrl}\\]|\\[\\'"bfnrt]|\\u[a-fA-F0-9]{4})*""" + "'").r 
^^ {
-      str => Literal(str.substring(1, str.length - 1))
-    }
+  // string with single quotes such as 'It''s me.'
+  lazy val singleQuoteStringLiteral: Parser[Expression] = "'((?:''|[^'])*)'".r 
^^ {
 
 Review comment:
   Should we also add `?:` in the outer matches? Same for 
`doubleQuoteStringLiteral `.
   ((?:''|[^'])*)-> (?:(?:''|[^'])*)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to