Copilot commented on code in PR #9383:
URL: https://github.com/apache/seatunnel/pull/9383#discussion_r2115164536


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCreateTableSqlBuilder.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.seatunnel.connectors.seatunnel.jdbc.catalog.oceanbase;
+
+import org.apache.seatunnel.api.table.catalog.CatalogTable;
+import org.apache.seatunnel.api.table.catalog.Column;
+import 
org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.oracle.OracleCreateTableSqlBuilder;
+import 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.DatabaseIdentifier;
+import 
org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.oracle.OracleTypeConverter;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class OceanBaseOracleCreateTableSqlBuilder extends 
OracleCreateTableSqlBuilder {
+
+    public OceanBaseOracleCreateTableSqlBuilder(CatalogTable catalogTable, 
boolean createIndex) {
+        super(catalogTable, createIndex);
+    }
+
+    @Override
+    protected String buildColumnSql(Column column) {
+        StringBuilder columnSql = new StringBuilder();
+        columnSql.append("\"").append(column.getName()).append("\" ");
+
+        String columnType = null;
+        if (column.getSinkType() != null) {
+            columnType = column.getSinkType();
+        } else if (StringUtils.isNotBlank(column.getSourceType())) {
+            if (StringUtils.equalsIgnoreCase(DatabaseIdentifier.OCENABASE, 
sourceCatalogName)) {

Review Comment:
   The constant `DatabaseIdentifier.OCENABASE` appears to be misspelled; it 
should likely be `OCEANBASE` to correctly detect OceanBase mode.
   ```suggestion
               if (StringUtils.equalsIgnoreCase(DatabaseIdentifier.OCEANBASE, 
sourceCatalogName)) {
   ```



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oracle/OracleCreateTableSqlBuilder.java:
##########
@@ -72,6 +74,15 @@ public List<String> build(TablePath tablePath) {
         createTableSql.append(String.join(",\n", columnSqls));
         createTableSql.append("\n)");
         sqls.add(createTableSql.toString());
+        if (comment != null) {

Review Comment:
   [nitpick] Use `StringUtils.isNotBlank(comment)` instead of `comment != null` 
to avoid emitting an empty `COMMENT ON TABLE` statement when the comment is an 
empty string.
   ```suggestion
           if (StringUtils.isNotBlank(comment)) {
   ```



-- 
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]

Reply via email to