zhoulii commented on code in PR #2932:
URL: 
https://github.com/apache/incubator-streampark/pull/2932#discussion_r1289614801


##########
streampark-flink/streampark-flink-connector/streampark-flink-connector-base/src/main/scala/org/apache/streampark/flink/connector/failover/SinkRequest.scala:
##########
@@ -30,21 +30,21 @@ case class SinkRequest(records: util.List[String], var 
attemptCounter: Int = 0)
   def size: Int = records.size()
 
   private[this] lazy val TABLE_REGEXP =
-    Pattern.compile("(insert\\s+into|update|delete)\\s+(.*?)(\\(|\\s+)", 
Pattern.CASE_INSENSITIVE)
+    Pattern.compile("^\\s*(insert\\s+into|update|delete)\\s+(.*?)(\\(|\\s+)", 
Pattern.CASE_INSENSITIVE)
 
   private[this] lazy val INSERT_REGEXP =
-    Pattern.compile("^(.*)\\s+(values|value)(.*)", Pattern.CASE_INSENSITIVE)
+    
Pattern.compile("^\\s*(insert\\s+into)\\s+(`?([a-zA-Z]\\w*)`?.)?`?([a-zA-Z]\\w*)`?((\\s*\\((\\s*`?[a-zA-Z]\\w*`?\\s*)*\\))|(\\s+))\\s*(value|values)\\s*(\\(.*\\))\\s*;?",
 Pattern.CASE_INSENSITIVE)

Review Comment:
   The regex expression here is too complicated, can you make it simpler ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to