XiaoJiang521 commented on code in PR #5535:
URL: https://github.com/apache/seatunnel/pull/5535#discussion_r1361479823
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/mysql/MySqlCatalog.java:
##########
@@ -200,4 +201,16 @@ private SeaTunnelDataType<?> fromJdbcType(String typeName,
int precision, int sc
dataTypeProperties.put(MysqlDataTypeConvertor.SCALE, scale);
return DATA_TYPE_CONVERTOR.toSeaTunnelType(mysqlType,
dataTypeProperties);
}
+
+ @Override
+ protected String getTruncateTableSql(TablePath tablePath) throws
CatalogException {
+ return String.format(
+ "TRUNCATE TABLE %s.%s;", tablePath.getDatabaseName(),
tablePath.getTableName());
+ }
+
Review Comment:
need add dialect for example : `%s`.`%s` or
tablePath.getDatabaseName("`"),Because we now support upper and lower
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/mysql/MySqlCatalog.java:
##########
@@ -200,4 +201,16 @@ private SeaTunnelDataType<?> fromJdbcType(String typeName,
int precision, int sc
dataTypeProperties.put(MysqlDataTypeConvertor.SCALE, scale);
return DATA_TYPE_CONVERTOR.toSeaTunnelType(mysqlType,
dataTypeProperties);
}
+
+ @Override
+ protected String getTruncateTableSql(TablePath tablePath) throws
CatalogException {
+ return String.format(
+ "TRUNCATE TABLE %s.%s;", tablePath.getDatabaseName(),
tablePath.getTableName());
+ }
+
+ public String getCountSql(TablePath tablePath) {
+ return String.format(
+ "select * from %s.%s limit 1;",
+ tablePath.getDatabaseName(), tablePath.getTableName());
+ }
Review Comment:
need add dialect for example : %s.%s or
tablePath.getDatabaseName("`"),Because we now support upper and lower
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/psql/PostgresCatalog.java:
##########
@@ -1,12 +1,13 @@
/*
- * 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
+ * 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
+ * http://www.apache.org/licenses/LICENSE-2.0
*
Review Comment:
Why update LICENSE-2.0
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oracle/OracleCatalog.java:
##########
@@ -223,4 +235,16 @@ protected String getUrlFromDatabaseName(String
databaseName) {
protected String getOptionTableName(TablePath tablePath) {
return tablePath.getSchemaAndTableName();
}
+
+ public String getCountSql(TablePath tablePath) {
+ return String.format(
+ "select * from %s.%s WHERE ROWNUM=1 ",
+ tablePath.getSchemaName(), tablePath.getTableName());
Review Comment:
need add dialect for example : %s.%s or
tablePath.getDatabaseName("\\""),Because we now support upper and lower. is
oracle table name is lower ,The table name query is automatically capitalized
here
##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oracle/OracleCatalog.java:
##########
@@ -223,4 +235,16 @@ protected String getUrlFromDatabaseName(String
databaseName) {
protected String getOptionTableName(TablePath tablePath) {
return tablePath.getSchemaAndTableName();
}
+
+ public String getCountSql(TablePath tablePath) {
+ return String.format(
+ "select * from %s.%s WHERE ROWNUM=1 ",
+ tablePath.getSchemaName(), tablePath.getTableName());
Review Comment:
need add dialect for example : %s.%s or
tablePath.getDatabaseName("\\""),Because we now support upper and lower. is
oracle table name is lower ,The table name query is automatically capitalized
here
--
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]