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/06/16 02:01:44 UTC

[GitHub] [flink-table-store] tsreaper commented on a diff in pull request #158: [FLINK-28079] Check Hive DDL against table store schema when creating table

tsreaper commented on code in PR #158:
URL: https://github.com/apache/flink-table-store/pull/158#discussion_r898626041


##########
flink-table-store-hive/src/main/java/org/apache/flink/table/store/hive/HiveSchema.java:
##########
@@ -18,50 +18,67 @@
 
 package org.apache.flink.table.store.hive;
 
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.table.store.file.FileStoreOptions;
+import org.apache.flink.table.store.file.schema.Schema;
+import org.apache.flink.table.store.file.schema.SchemaManager;
+import org.apache.flink.table.types.logical.LogicalType;
 import org.apache.flink.util.Preconditions;
 
+import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants;
 import org.apache.hadoop.hive.serde.serdeConstants;
 import org.apache.hadoop.hive.serde2.SerDeUtils;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
+import java.util.stream.Collectors;
 
 /** Column names, types and comments of a Hive table. */
 public class HiveSchema {
 
-    private final List<String> fieldNames;
-    private final List<TypeInfo> fieldTypeInfos;
+    private static final String TBLPROPERTIES_PREFIX = "table-store.";
+    private static final String TBLPROPERTIES_PRIMARY_KEYS = TBLPROPERTIES_PREFIX + "primary-keys";

Review Comment:
   We need to check that the primary keys in Hive DDL match the primary keys in schema. As Hive does not support primary keys we have to implement this in table properties.



-- 
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