You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "XiaoJiang521 (via GitHub)" <gi...@apache.org> on 2023/09/05 05:36:41 UTC

[GitHub] [seatunnel] XiaoJiang521 opened a new pull request, #5089: [feature][jdbc] Jdbc database support identifier

XiaoJiang521 opened a new pull request, #5089:
URL: https://github.com/apache/seatunnel/pull/5089

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update change log that in connector document. For more details you can refer to [connector-v2](https://github.com/apache/seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     3. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] XiaoJiang521 commented on pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "XiaoJiang521 (via GitHub)" <gi...@apache.org>.
XiaoJiang521 commented on PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#issuecomment-1646510333

   This ci error is not my error, and why my e2e is not triggering the ci


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "ic4y (via GitHub)" <gi...@apache.org>.
ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier
URL: https://github.com/apache/seatunnel/pull/5089


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] ic4y commented on pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "ic4y (via GitHub)" <gi...@apache.org>.
ic4y commented on PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#issuecomment-1670793173

   Related documents need to be updated


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] Hisoka-X commented on a diff in pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X commented on code in PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#discussion_r1264299271


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java:
##########
@@ -144,4 +144,10 @@ public interface JdbcOptions {
                     .intType()
                     .noDefaultValue()
                     .withDescription("partition num");
+
+    Option<String> FIELD_IDE =
+            Options.key("field_ide")
+                    .stringType()

Review Comment:
   We support enum type, please use it.



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresDialect.java:
##########
@@ -88,4 +97,32 @@ public PreparedStatement creatPreparedStatement(
         }
         return statement;
     }
+
+    @Override
+    public String tableIdentifier(String database, String tableName) {
+        // resolve pg database name upper or lower not recognised
+        return quoteDatabaseIdentifier(database) + "." + quoteIdentifier(tableName);
+    }
+
+    @Override
+    public String quoteIdentifier(String identifier) {

Review Comment:
   Please add test case for this new feature.



-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] XiaoJiang521 commented on pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "XiaoJiang521 (via GitHub)" <gi...@apache.org>.
XiaoJiang521 commented on PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#issuecomment-1670876850

   > Do we need to add this in the jdbc doc?
   
   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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] EricJoy2048 closed pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "EricJoy2048 (via GitHub)" <gi...@apache.org>.
EricJoy2048 closed pull request #5089: [feature][jdbc] Jdbc database support identifier
URL: https://github.com/apache/seatunnel/pull/5089


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] Hisoka-X merged pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "Hisoka-X (via GitHub)" <gi...@apache.org>.
Hisoka-X merged PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] XiaoJiang521 commented on a diff in pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "XiaoJiang521 (via GitHub)" <gi...@apache.org>.
XiaoJiang521 commented on code in PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#discussion_r1270609307


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresDialect.java:
##########
@@ -88,4 +97,32 @@ public PreparedStatement creatPreparedStatement(
         }
         return statement;
     }
+
+    @Override
+    public String tableIdentifier(String database, String tableName) {
+        // resolve pg database name upper or lower not recognised
+        return quoteDatabaseIdentifier(database) + "." + quoteIdentifier(tableName);
+    }
+
+    @Override
+    public String quoteIdentifier(String identifier) {

Review Comment:
   Done! e2e has been added



-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] XiaoJiang521 commented on pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "XiaoJiang521 (via GitHub)" <gi...@apache.org>.
XiaoJiang521 commented on PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#issuecomment-1671233542

   > Related documents need to be updated
   
   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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] hailin0 commented on a diff in pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#discussion_r1321665344


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java:
##########
@@ -154,4 +155,10 @@ public interface JdbcOptions {
                     .intType()
                     .noDefaultValue()
                     .withDescription("partition num");
+
+    Option<FieldIdeEnum> FIELD_IDE =
+            Options.key("field_ide")

Review Comment:
   ```suggestion
               Options.key("sql_identifier_case_sensitive")
   ```



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dialectenum/FieldIdeEnum.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.internal.dialect.dialectenum;

Review Comment:
   ```suggestion
   package org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect;
   ```



-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "ic4y (via GitHub)" <gi...@apache.org>.
ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier
URL: https://github.com/apache/seatunnel/pull/5089


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] hailin0 commented on a diff in pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #5089:
URL: https://github.com/apache/seatunnel/pull/5089#discussion_r1321667238


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/config/JdbcOptions.java:
##########
@@ -154,4 +155,10 @@ public interface JdbcOptions {
                     .intType()
                     .noDefaultValue()
                     .withDescription("partition num");
+
+    Option<FieldIdeEnum> FIELD_IDE =
+            Options.key("field_ide")

Review Comment:
   or `identifier_case_sensitive `



-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [seatunnel] ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier

Posted by "ic4y (via GitHub)" <gi...@apache.org>.
ic4y closed pull request #5089: [feature][jdbc] Jdbc database support identifier
URL: https://github.com/apache/seatunnel/pull/5089


-- 
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-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org