[x] I had searched in the issues and found no similar issues.
Java Version
1.8
Scala Version
2.11.x
StreamPark Version
1.2.3
Flink Version
1.13.6
deploy mode
yarn-application
What happened
When I insert data into the database (clickhouse) through streamx-flink-connector-clickhouse_2.11, there are some cases where the insertion fails. I know the cause of this bug. In the class file org.apache.streampark.flink.connector.failover.SinkRequest, the regular expression INSERT_REGEXP will fail to extract the data to be inserted.
lazy val sqlStatement: String = {
val prefixMap: Map[String, List[String]] = Map[String, List[String]]()
records.foreach(
x => {
val valueMatcher = INSERT_REGEXP.matcher(x)
if (valueMatcher.find()) {
val prefix = valueMatcher.group(1)
prefixMap.get(prefix) match {
case Some(value) => value.add(valueMatcher.group(3))
case None => prefixMap.put(prefix, List(valueMatcher.group(3)))
}
} else {
logWarn(s"ignore record: $x")
}
})
Give an example. When the insert statement is "INSERT INTO table(a) value(' value of')", the program originally expected to extract the string is (' value of'), but it is indeed of') , which will cause a splicing error in the SQL statement. Another example. When the insert statement is "INSERT INTO table(a) values('a')", the program originally expected to extract the string is ('a'), but it is indeed s('a'). I think it would be better to have a more robust extraction method, but I'm out of good ideas.
Search before asking
Java Version
1.8
Scala Version
2.11.x
StreamPark Version
1.2.3
Flink Version
1.13.6
deploy mode
yarn-application
What happened
When I insert data into the database (clickhouse) through streamx-flink-connector-clickhouse_2.11, there are some cases where the insertion fails. I know the cause of this bug. In the class file org.apache.streampark.flink.connector.failover.SinkRequest, the regular expression INSERT_REGEXP will fail to extract the data to be inserted.
Give an example. When the insert statement is
"INSERT INTO table(a) value(' value of')"
, the program originally expected to extract the string is(' value of')
, but it is indeedof')
, which will cause a splicing error in the SQL statement. Another example. When the insert statement is"INSERT INTO table(a) values('a')"
, the program originally expected to extract the string is('a')
, but it is indeeds('a')
. I think it would be better to have a more robust extraction method, but I'm out of good ideas.Error Exception
Screenshots
No response
Are you willing to submit PR?
Code of Conduct