caogaoshuai commented on code in PR #2932:
URL:
https://github.com/apache/incubator-streampark/pull/2932#discussion_r1290113251
##########
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:
I found the simplest solution, which only needs to add one character to the
original code. The commit is "
refactor: amazing solution"
--
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]