zhuangchong commented on code in PR #970: URL: https://github.com/apache/incubator-paimon/pull/970#discussion_r1174556170
########## paimon-hive/paimon-hive-connector-common/src/main/java/org/apache/paimon/hive/PaimonMetaHook.java: ########## @@ -18,34 +18,86 @@ 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.TableFactory; import org.apache.hadoop.hive.metastore.HiveMetaHook; +import org.apache.hadoop.hive.metastore.MetaStoreUtils; +import org.apache.hadoop.hive.metastore.TableType; +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 PaimonJobConf paimonJobConf; + + public PaimonMetaHook(PaimonJobConf paimonJobConf) { + this.paimonJobConf = paimonJobConf; + } @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 (!MetaStoreUtils.isExternalTable(table)) { + throw new MetaException("Paimon supports only " + TableType.EXTERNAL_TABLE + "."); Review Comment: There was a problem with understanding before, I have removed this part of the code verification. -- 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