You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/07 13:45:03 UTC

[GitHub] [flink-table-store] SteNicholas commented on a diff in pull request #413: [FLINK-30255] Throw exception when names are upper case in HiveCatalog

SteNicholas commented on code in PR #413:
URL: https://github.com/apache/flink-table-store/pull/413#discussion_r1042223986


##########
flink-table-store-hive/flink-table-store-hive-catalog/src/main/java/org/apache/flink/table/store/hive/HiveCatalog.java:
##########
@@ -269,6 +271,26 @@ protected String warehouse() {
         return hiveConf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname);
     }
 
+    private void checkObjectPathUpperCase(ObjectPath objectPath) {
+        checkState(
+                objectPath.getDatabaseName().equals(objectPath.getDatabaseName().toLowerCase()),
+                String.format(
+                        "Database name[%s] cannot contain upper case",
+                        objectPath.getDatabaseName()));
+        checkState(
+                objectPath.getObjectName().equals(objectPath.getObjectName().toLowerCase()),
+                String.format(
+                        "Table name[%s] cannot contain upper case", objectPath.getObjectName()));
+    }
+
+    private void checkFieldNamesUpperCase(List<String> fieldNames) {
+        for (String fieldName : fieldNames) {
+            checkState(

Review Comment:
   Could we check the state of `fieldNames` not single `fieldName`? IMO, it's better to provide users with all upper case field names once.



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org