-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-34088] [hotfix] fix the problems with special table name characters of postgres and oracle and sqlserver. #89
base: main
Are you sure you want to change the base?
Conversation
…res and oracle and sqlserver.
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
…res and oracle and sqlserver. update test case.
add the commit to update test case |
…in oracle jdbc,Specify the required type explicitly
…roperly in oracle jdbc,Specify the required type explicitly" This reverts commit 7272a79.
public static String handleDoubleQuotes(String identifier) { | ||
String[] split = identifier.split("\\."); | ||
StringBuilder builder = new StringBuilder(); | ||
for (String s : split) { | ||
builder.append("\"").append(s).append("\""); | ||
builder.append("."); | ||
} | ||
return builder.deleteCharAt(builder.length() - 1).toString(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get why we are going to put logic with double quotes into some generic place if for different engines there could be different quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because oracle and postgres have the same escape characters, It's all double quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this package is not only for oracle and postgres. E.g. MS SQL Server, MySQL are different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that the location of this method is not appropriate, I think it is OK, the specific escape characters of the data source in their own package implementation, there are public features to extract and did not find a better location
"INSERT INTO \"tbl\"(\"id\", \"name\", \"email\", \"ts\", \"field1\", \"field_2\", \"__field_3__\") " | ||
+ "VALUES (:id, :name, :email, :ts, :field1, :field_2, :__field_3__)"); | ||
NamedStatementMatcher.parsedSql( | ||
"INSERT INTO tbl(id, name, email, ts, field1, field_2, __field_3__) " | ||
"INSERT INTO \"tbl\"(\"id\", \"name\", \"email\", \"ts\", \"field1\", \"field_2\", \"__field_3__\") " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In issue description it was only something about table name
why does it impact columns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the method ‘quoteIdentifier’ is common,column metadata is also by call the method.Columns should have this problem as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a failing test reproducing the problem?
I guess we can extract information about current quote identifier directly from JDBCDriver |
I get it. If there are no compatibility issues, It's better this way. |
I thought the method |
yep, may be it is a point to see whether we could adapt it or not btw I haven't found any test reproducing the issue, can you add one? |
[hotfix] fix the problems with special table name characters of postgres and oracle and sqlserver.