JingsongLi commented on code in PR #475: URL: https://github.com/apache/flink-table-store/pull/475#discussion_r1066589722
########## docs/layouts/shortcodes/generated/hive_catalog_configuration.html: ########## @@ -0,0 +1,18 @@ +<table class="configuration table table-bordered"> + <thead> + <tr> + <th class="text-left" style="width: 20%">Key</th> + <th class="text-left" style="width: 15%">Default</th> + <th class="text-left" style="width: 10%">Type</th> + <th class="text-left" style="width: 55%">Description</th> + </tr> + </thead> + <tbody> + <tr> + <td><h5>metastore.client.class</h5></td> + <td style="word-wrap: break-word;">"org.apache.flink.table.store.shaded.org.apache.hadoop.hive.metastore.HiveMetaStoreClient"</td> Review Comment: Maybe we don't need this documentation. I think this option should be inner. It is not so good to expose a shaded interface. (`IMetaStoreClient` is shaded) ########## flink-table-store-hive/flink-table-store-hive-catalog/src/main/java/org/apache/flink/table/store/hive/HiveCatalogFactory.java: ########## @@ -41,13 +40,21 @@ public String identifier() { public Catalog create(String warehouse, Configuration options) { String uri = Preconditions.checkNotNull( - options.get(URI), - URI.key() + " must be set for table store " + IDENTIFIER + " catalog"); + options.get(CatalogOptions.URI), + CatalogOptions.URI.key() + + " must be set for table store " + + IDENTIFIER + + " catalog"); + org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration(); options.toMap().forEach(hadoopConfig::set); + hadoopConfig.set( Review Comment: We can add test for here. May a mock `IMetaStoreClient` just implement `getAllDatabases` to verify. ########## flink-table-store-hive/flink-table-store-hive-catalog/src/main/java/org/apache/flink/table/store/hive/HiveCatalogOptions.java: ########## @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.store.hive; + +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.ConfigOptions; + +import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; + +/** Specific config options for {@link HiveCatalogFactory}. */ +public class HiveCatalogOptions { + + public static final ConfigOption<String> METASTORE_CLIENT_CLASS = + ConfigOptions.key("metastore.client.class") + .stringType() + .defaultValue(HiveMetaStoreClient.class.getName()) + .withDescription("Class name of Hive metastore client"); Review Comment: NOTE it should be shaded? ########## flink-table-store-hive/flink-table-store-hive-catalog/src/main/java/org/apache/flink/table/store/hive/HiveCatalog.java: ########## @@ -63,6 +64,9 @@ /** A catalog implementation for Hive. */ public class HiveCatalog extends AbstractCatalog { + public static final String INTERNAL_METASTORE_CLIENT_CLASS = Review Comment: Maybe we don't need this key. We can just pass class by the constructor of `HiveCatalog`. -- 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