LadyForest commented on code in PR #137: URL: https://github.com/apache/flink-table-store/pull/137#discussion_r894982074
########## flink-table-store-core/src/main/java/org/apache/flink/table/store/file/catalog/TableStoreCatalogFactory.java: ########## @@ -0,0 +1,74 @@ +/* + * 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.file.catalog; + +import org.apache.flink.configuration.ConfigOption; +import org.apache.flink.configuration.ConfigOptions; +import org.apache.flink.configuration.ReadableConfig; +import org.apache.flink.core.fs.Path; +import org.apache.flink.table.factories.CatalogFactory; +import org.apache.flink.table.factories.FactoryUtil; + +import java.util.HashSet; +import java.util.Set; + +import static org.apache.flink.table.factories.FactoryUtil.PROPERTY_VERSION; + +/** Factory for {@link TableStoreCatalog}. */ +public class TableStoreCatalogFactory implements CatalogFactory { + + public static final ConfigOption<String> DEFAULT_DATABASE = + ConfigOptions.key("default-database").stringType().defaultValue("default"); + + public static final ConfigOption<String> ROOT_PATH = + ConfigOptions.key("root-path") Review Comment: > - `warehouse` for managed table. I think we can adjust this to `warehouse/${database}.db/${tableName}`. > - `warehouse` for catalog. `root-path/${database}.db/${tableName}`. > - `path`: table path. `warehouse` is a good idea. But for the managed table, I found the following case needs further discussion. E.g. ```sql -- set session configuration SET 'table-store.warehouse' = '/foo/'; -- create another in-memory catalog, which supports creating managed tables CREATE CATALOG my_default WITH ( 'type' = 'generic_in_memory' ); USE CATALOG my_default; CREATE TABLE T ( f0 INT, f1 STRING ); -- switch back to default USE CATALOG `default`; CREATE TABLE T ( f0 INT ); ``` Both of them will create the folder tree as `/foo/warehouse/default.db/T` -- 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]
