zy-kkk commented on code in PR #20109: URL: https://github.com/apache/doris/pull/20109#discussion_r1213230987
########## fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcOracleClient.java: ########## @@ -0,0 +1,124 @@ +// 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.doris.external.jdbc; + +import org.apache.doris.catalog.ScalarType; +import org.apache.doris.catalog.Type; + +public class JdbcOracleClient extends JdbcClient { + + protected JdbcOracleClient(JdbcClientConfig jdbcClientConfig) { + super(jdbcClientConfig); + } + + @Override + protected String getDatabaseQuery() { + return "SELECT DISTINCT OWNER FROM all_tables"; + } + + @Override + protected String modifyTableNameIfNecessary(String tableName) { + return tableName.replace("/", "%"); + } + + @Override + protected boolean isTableModified(String modifiedTableName, String actualTableName) { + return !modifiedTableName.equals(actualTableName); + } + + @Override + protected Type jdbcTypeToDoris(JdbcFieldSchema fieldSchema) { + String oracleType = fieldSchema.getDataTypeName(); + if (oracleType.startsWith("INTERVAL")) { + oracleType = oracleType.substring(0, 8); + } else if (oracleType.startsWith("TIMESTAMP")) { + if (oracleType.equals("TIMESTAMPTZ") || oracleType.equals("TIMESTAMPLTZ")) { + return Type.UNSUPPORTED; + } + // oracle can support nanosecond, will lose precision + return ScalarType.createDatetimeV2Type(JDBC_DATETIME_SCALE); + } Review Comment: Thanks for your suggestion, I will change it in the next refactoring for data type matching -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org