diqiu50 commented on code in PR #9776: URL: https://github.com/apache/gravitino/pull/9776#discussion_r2757655858
########## catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/ClickHouseTablePropertiesMetadata.java: ########## @@ -0,0 +1,193 @@ +/* + * 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.gravitino.catalog.clickhouse; + +import static org.apache.gravitino.catalog.clickhouse.ClickHouseConstants.CLUSTER_REMOTE_DATABASE; +import static org.apache.gravitino.catalog.clickhouse.ClickHouseConstants.ON_CLUSTER; +import static org.apache.gravitino.connector.PropertyEntry.enumImmutablePropertyEntry; +import static org.apache.gravitino.connector.PropertyEntry.stringOptionalPropertyEntry; +import static org.apache.gravitino.connector.PropertyEntry.stringReservedPropertyEntry; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.apache.commons.collections4.BidiMap; +import org.apache.commons.collections4.bidimap.TreeBidiMap; +import org.apache.gravitino.catalog.jdbc.JdbcTablePropertiesMetadata; +import org.apache.gravitino.connector.PropertyEntry; + +public class ClickHouseTablePropertiesMetadata extends JdbcTablePropertiesMetadata { + public static final String GRAVITINO_ENGINE_KEY = + ClickHouseConstants.GRAVITINO_CLICKHOUSE_ENGINE_NAME; + public static final String CLICKHOUSE_ENGINE_KEY = ClickHouseConstants.CLICKHOUSE_ENGINE_NAME; + + public static final PropertyEntry<String> COMMENT_PROPERTY_ENTRY = + stringReservedPropertyEntry(COMMENT_KEY, "The table comment", true); + public static final PropertyEntry<ENGINE> ENGINE_PROPERTY_ENTRY = + enumImmutablePropertyEntry( + GRAVITINO_ENGINE_KEY, + "The table engine", + false, + ENGINE.class, + ENGINE.MERGETREE, + false, + false); + public static final PropertyEntry<String> ON_CLUSTER_PROPERTY_ENTRY = + stringOptionalPropertyEntry( + ON_CLUSTER, "The cluster name for ClickHouse distributed tables", false, "", false); + public static final PropertyEntry<String> CLUSTER_REMOTE_DATABASE_PROPERTY_ENTRY = + stringOptionalPropertyEntry( + CLUSTER_REMOTE_DATABASE, + "The remote database name for ClickHouse distributed tables", + false, + "", + false); + public static final PropertyEntry<String> CLUSTER_REMOTE_TABLE_PROPERTY_ENTRY = + stringOptionalPropertyEntry( + ClickHouseConstants.CLUSTER_REMOTE_TABLE, + "The remote table name for ClickHouse distributed tables", + false, + "", + false); + public static final PropertyEntry<String> CLUSTER_SHARDING_KEY_PROPERTY_ENTRY = + stringOptionalPropertyEntry( + ClickHouseConstants.CLUSTER_SHARDING_KEY, + "The sharding key for ClickHouse distributed tables", + false, + "", + false); Review Comment: ``` // Sharding key for the clickhouse cluster public static final String CLUSTER_SHARDING_KEY = "cluster-sharding-key"; public static final String CLUSTER_REMOTE_DATABASE = "cluster-remote-database"; public static final String CLUSTER_REMOTE_TABLE = "cluster-remote-table"; ``` Why do we add these keys -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
