[ 
https://issues.apache.org/jira/browse/FLINK-31419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699548#comment-17699548
 ] 

Woong Wen Tat commented on FLINK-31419:
---------------------------------------

Fix is to add the period to be recognized as a legal character in the function 
org.apache.flink.connector.jdbc.statement.FieldNamedPreparedStatementImpl#parseNamedStatement

  while (j < length && (Character.isJavaIdentifierPart(sql.charAt(j))  || '.' 
== sql.charAt(j))) {

> Flink-JDBC should allow . in field names
> ----------------------------------------
>
>                 Key: FLINK-31419
>                 URL: https://issues.apache.org/jira/browse/FLINK-31419
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC
>            Reporter: Woong Wen Tat
>            Priority: Major
>
> Currently, the method 
> org.apache.flink.connector.jdbc.statement.FieldNamedPreparedStatementImpl#parseNamedStatement
>  parses . (period) in file name as an illegal character, so the statement
> ```
> INSERT INTO `tbl`(`action.id`, `action.name`, `email`, `ts`, `field1`, 
> `field_2`, `__field_3__`) VALUES (:id, :name, :email, :ts, :field1, :field_2, 
> :__field_3__)
> ``` does not get parsed into
> ```
> INSERT INTO `tbl`(`action.id`, `action.name`, `email`, `ts`, `field1`, 
> `field_2`, `__field_3__`) VALUES (:id, :action.name, :email, :ts, :field1, 
> :field_2, :__field_3__)
> ```
> Instead, action.id and action.name will be parsed to the same name - action, 
> this causes incompatible schema with the database



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to