yuanoOo commented on code in PR #4918: URL: https://github.com/apache/gravitino/pull/4918#discussion_r1764790912
########## catalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/converter/OceanBaseTypeConverter.java: ########## @@ -0,0 +1,53 @@ +/* + * 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.oceanbase.converter; + +import org.apache.gravitino.catalog.jdbc.converter.JdbcTypeConverter; +import org.apache.gravitino.rel.types.Type; +import org.apache.gravitino.rel.types.Types; + +/** Type converter for OceanBase. */ +public class OceanBaseTypeConverter extends JdbcTypeConverter { + + // More data types will be added. + static final String TINYINT = "tinyint"; + + @Override + public Type toGravitino(JdbcTypeBean typeBean) { + switch (typeBean.getTypeName().toLowerCase()) { Review Comment: done. ########## catalogs/catalog-jdbc-oceanbase/src/main/java/org/apache/gravitino/catalog/oceanbase/operation/OceanBaseDatabaseOperations.java: ########## @@ -0,0 +1,80 @@ +/* + * 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.oceanbase.operation; + +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import org.apache.gravitino.catalog.jdbc.JdbcSchema; +import org.apache.gravitino.catalog.jdbc.operation.JdbcDatabaseOperations; +import org.apache.gravitino.exceptions.NoSuchSchemaException; +import org.apache.gravitino.meta.AuditInfo; + +/** Database operations for OceanBase. */ +public class OceanBaseDatabaseOperations extends JdbcDatabaseOperations { + + public static final Set<String> SYS_OCEANBASE_DATABASE_NAMES = createSysOceanBaseDatabaseNames(); + + private static Set<String> createSysOceanBaseDatabaseNames() { + Set<String> set = new HashSet<>(); + set.add("information_schema"); + set.add("mysql"); + set.add("sys"); + set.add("oceanbase"); + return Collections.unmodifiableSet(set); + } + + @Override + public String generateCreateDatabaseSql( + String databaseName, String comment, Map<String, String> properties) { + + throw new UnsupportedOperationException("Not implemented yet."); + } + + @Override + public String generateDropDatabaseSql(String databaseName, boolean cascade) { + throw new UnsupportedOperationException("Not implemented yet."); + } + + @Override + public JdbcSchema load(String databaseName) throws NoSuchSchemaException { Review Comment: done. -- 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]
