zhuangchong commented on code in PR #970: URL: https://github.com/apache/incubator-paimon/pull/970#discussion_r1185858525
########## paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/PaimonMetaHook.java: ########## @@ -18,34 +18,83 @@ package org.apache.paimon.hive; +import org.apache.paimon.CoreOptions; +import org.apache.paimon.catalog.CatalogContext; import org.apache.paimon.hive.mapred.PaimonInputFormat; import org.apache.paimon.hive.mapred.PaimonOutputFormat; -import org.apache.paimon.utils.Preconditions; +import org.apache.paimon.options.Options; +import org.apache.paimon.schema.Schema; +import org.apache.paimon.schema.TableSchema; +import org.apache.paimon.table.TableUtils; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.metastore.HiveMetaHook; +import org.apache.hadoop.hive.metastore.MetaStoreUtils; +import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.Table; +import java.util.List; +import java.util.Optional; + +import static org.apache.paimon.hive.HiveTypeUtils.typeInfoToLogicalType; + /** * {@link HiveMetaHook} for paimon. Currently this class is only used to set input and output * formats. */ public class PaimonMetaHook implements HiveMetaHook { + private static final String COMMENT = "comment"; + private final Configuration conf; + + public PaimonMetaHook(Configuration conf) { + this.conf = conf; + } @Override public void preCreateTable(Table table) throws MetaException { - Preconditions.checkArgument( - !table.isSetPartitionKeys() || table.getPartitionKeys().isEmpty(), - "Paimon currently does not support creating partitioned table " - + "with PARTITIONED BY clause. If you want to query from a partitioned table, " - + "please add partition columns into the ordinary table columns."); + if (table.getPartitionKeysSize() != 0) { + throw new MetaException( + "Paimon currently does not support creating partitioned table " + + "with PARTITIONED BY clause. If you want to query from a partitioned table, " Review Comment: we support pk and partition and options through hive properties. document link: https://github.com/apache/incubator-paimon/blob/0a006a9954466751948cf854eeda056978b721bf/docs/content/how-to/creating-tables.md?plain=1#L71-L79 https://github.com/apache/incubator-paimon/blob/0a006a9954466751948cf854eeda056978b721bf/docs/content/how-to/creating-tables.md?plain=1#L127-L142 https://github.com/apache/incubator-paimon/blob/0a006a9954466751948cf854eeda056978b721bf/docs/content/how-to/creating-tables.md?plain=1#L345-L362 test case: https://github.com/apache/incubator-paimon/blob/0a006a9954466751948cf854eeda056978b721bf/paimon-hive/paimon-hive-connector-common/src/test/java/org/apache/paimon/hive/CreateTableITCase.java#L138-L244 -- 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...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org