[GitHub] [flink-table-store] zjureel commented on a diff in pull request #383: [FLINK-30033] Add primary key type validation
zjureel commented on code in PR #383: URL: https://github.com/apache/flink-table-store/pull/383#discussion_r1024730773 ## flink-table-store-core/src/main/java/org/apache/flink/table/store/file/schema/SchemaManager.java: ## @@ -157,6 +159,33 @@ public TableSchema commitNewVersion(UpdateSchema updateSchema) throws Exception } } +private void validatePrimaryKeysType(UpdateSchema updateSchema, List primaryKeys) { +if (!primaryKeys.isEmpty()) { +Map rowFields = new HashMap<>(); +for (RowType.RowField rowField : updateSchema.rowType().getFields()) { +rowFields.put(StringUtils.lowerCase(rowField.getName()), rowField); Review Comment: I will try to fix it later > I created a jira for hive https://issues.apache.org/jira/browse/FLINK-29988 -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink-table-store] zjureel commented on a diff in pull request #383: [FLINK-30033] Add primary key type validation
zjureel commented on code in PR #383: URL: https://github.com/apache/flink-table-store/pull/383#discussion_r1024702921 ## flink-table-store-core/src/main/java/org/apache/flink/table/store/file/schema/SchemaManager.java: ## @@ -157,6 +159,33 @@ public TableSchema commitNewVersion(UpdateSchema updateSchema) throws Exception } } +private void validatePrimaryKeysType(UpdateSchema updateSchema, List primaryKeys) { +if (!primaryKeys.isEmpty()) { +Map rowFields = new HashMap<>(); +for (RowType.RowField rowField : updateSchema.rowType().getFields()) { +rowFields.put(StringUtils.lowerCase(rowField.getName()), rowField); Review Comment: I will remove `lowCase` here. But in fact there's a problem of the up/lowCase of table and column names. The ddl syntax between table store and spark/hive are different. The table and column name of spark/hive are case-insensitive, while in table store with flink, the table name is case-insensitive and column name is case-sensitive. I think we need to verify the duplicate table/column names in the table store to be case-insensitive to avoid confusion for the users. Then we can also use lowercase uniformly for comparison when doing some additional verification. What do you think? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [flink-table-store] zjureel commented on a diff in pull request #383: [FLINK-30033] Add primary key type validation
zjureel commented on code in PR #383: URL: https://github.com/apache/flink-table-store/pull/383#discussion_r1023527209 ## docs/content/docs/development/create-table.md: ## @@ -296,6 +296,24 @@ Use approach one if you have a large number of filtered queries with only `user_id`, and use approach two if you have a large number of filtered queries with only `catalog_id`. +The primary key data types currently supported by the table store +are as follows: +``` +| TinyIntType Review Comment: Good point, I found that the table store has richer data types than hive, I will update to check primary key in reverse -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org