You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhilinli123 (via GitHub)" <gi...@apache.org> on 2023/04/20 08:15:44 UTC

[GitHub] [incubator-seatunnel] zhilinli123 opened a new pull request, #4634: [Bug] [connector-jdbc] Fix Mysql bigint(20) cannot be used as a partition_column bug

zhilinli123 opened a new pull request, #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634

   issues:https://github.com/apache/incubator-seatunnel/issues/4627
   <!--
   
   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/incubator-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/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-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/incubator-seatunnel/tree/dev/docs/en/connector-v2)
     2. Update [plugin-mapping.properties](https://github.com/apache/incubator-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/incubator-seatunnel/blob/dev/seatunnel-dist/pom.xml)
   * [ ] Update the [`release-note`](https://github.com/apache/incubator-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] [incubator-seatunnel] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   CI success 
   


-- 
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] [incubator-seatunnel] hailin0 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -60,7 +60,8 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
             Lists.newArrayList(
                     "/jdbc_mysql_source_and_sink.conf",
                     "/jdbc_mysql_source_and_sink_parallel.conf",
-                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf");
+                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf",
+                    "/jdbc_mysql_source_and_sink_bu_parallel_upper_lower.conf");

Review Comment:
   incomprehensible abbreviation



-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source] Support for Decimal types as splict keys

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

   For the current pr- I will modify all source-documents related to boundary value types - in jdbc
   


-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   Wait for the CI to finish running


-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   > This is the document for now ![image](https://user-images.githubusercontent.com/76689593/233527933-f9ae7bee-e144-4306-a865-33a914149263.png)
   
   It is necessary to specify the supported data types clearly, such as Int, Long, etc


-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   From the design perspective, it is necessary to support any DecimalType with scale=0. Otherwise, DecimalType(20,0), DecimalType(30,0), etc., will need to be modified. So it's better to do it well in one go


-- 
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] [incubator-seatunnel] ic4y commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

Posted by "ic4y (via GitHub)" <gi...@apache.org>.
ic4y commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1190966392


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactory.java:
##########
@@ -200,7 +202,10 @@ static void validationPartitionColumn(String partitionColumn, SeaTunnelRowType r
     }
 
     private static boolean isNumericType(SeaTunnelDataType<?> type) {
-        return type.equals(BasicType.INT_TYPE) || type.equals(BasicType.LONG_TYPE);
+        // Currently, only numeric types are supported for reading partition keys
+        return type.equals(BasicType.INT_TYPE)
+                || type.equals(BasicType.LONG_TYPE)
+                || type.equals(new DecimalType(20, 0));

Review Comment:
   The current implementation support any DecimalType with scale=0.



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -64,6 +64,7 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
     private static final String CREATE_SQL =
             "CREATE TABLE IF NOT EXISTS %s\n"
                     + "(\n"
+                    + "    `c_bigint_30`          BIGINT(40) unsigned   DEFAULT NULL,\n"

Review Comment:
   It is recommended to directly use DECIMAL(30,0) for partition field testing.



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -194,11 +196,14 @@ Pair<String[], List<SeaTunnelRow>> initTestData() {
                 };
 
         List<SeaTunnelRow> rows = new ArrayList<>();
+        // Define a large bigint data value to test for compatibility above bigint(20)
+        BigDecimal testBigDecimalValue = new BigDecimal("2844674407371055000");
         for (int i = 0; i < 100; i++) {
             byte byteArr = Integer.valueOf(i).byteValue();
             SeaTunnelRow row =
                     new SeaTunnelRow(
                             new Object[] {
+                                testBigDecimalValue.add(BigDecimal.valueOf(i)),

Review Comment:
   Do not delete the column c_bit_1.



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -194,11 +196,14 @@ Pair<String[], List<SeaTunnelRow>> initTestData() {
                 };
 
         List<SeaTunnelRow> rows = new ArrayList<>();
+        // Define a large bigint data value to test for compatibility above bigint(20)
+        BigDecimal testBigDecimalValue = new BigDecimal("2844674407371055000");

Review Comment:
   The number 2844674407371055000 is within the storage range of a long. You should use a value that is outside of long's storage capacity, such as 899,999,999,999,999,999,999,999,999,999.



-- 
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] [incubator-seatunnel] zhilinli123 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1191395189


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -194,11 +196,14 @@ Pair<String[], List<SeaTunnelRow>> initTestData() {
                 };
 
         List<SeaTunnelRow> rows = new ArrayList<>();
+        // Define a large bigint data value to test for compatibility above bigint(20)
+        BigDecimal testBigDecimalValue = new BigDecimal("2844674407371055000");
         for (int i = 0; i < 100; i++) {
             byte byteArr = Integer.valueOf(i).byteValue();
             SeaTunnelRow row =
                     new SeaTunnelRow(
                             new Object[] {
+                                testBigDecimalValue.add(BigDecimal.valueOf(i)),

Review Comment:
   Please have a look. Thank you. @ic4y 



-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   I have solved some code conflicts, please help to open CI, thank you
   


-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   PTAL:@ic4y @Hisoka-X @hailin0  thks


-- 
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] [incubator-seatunnel] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   @ic4y @hailin0  Please check it out. Thank you
   


-- 
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] [incubator-seatunnel] hailin0 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -194,11 +200,16 @@ Pair<String[], List<SeaTunnelRow>> initTestData() {
                 };
 
         List<SeaTunnelRow> rows = new ArrayList<>();
+        BigDecimal bigintValue = new BigDecimal("2844674407371055000");
+        BigDecimal decimalValue = new BigDecimal("999999999999999999999999999899");
         for (int i = 0; i < 100; i++) {
             byte byteArr = Integer.valueOf(i).byteValue();
             SeaTunnelRow row =
                     new SeaTunnelRow(
                             new Object[] {
+                                bigintValue.add(BigDecimal.valueOf(i)),
+                                decimalValue.add(BigDecimal.valueOf(i)),
+                                decimalValue.add(BigDecimal.valueOf(i)),

Review Comment:
   move to end



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -150,6 +153,9 @@ String driverUrl() {
     Pair<String[], List<SeaTunnelRow>> initTestData() {
         String[] fieldNames =
                 new String[] {
+                    "c_bigint_30",
+                    "c_decimal_unsigned_30",
+                    "c_decimal_30",

Review Comment:
   move to end



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/resources/jdbc_mysql_source_and_sink_parallel_upper_lower.conf:
##########
@@ -46,12 +46,12 @@ sink {
         user = "root"
         password = "Abc!@#135_seatunnel"
         connection_check_timeout_sec = 100
-        query = """insert into sink (c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,
+        query = """insert into sink (c_bigint_30,c_decimal_unsigned_30,c_decimal_30,c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,

Review Comment:
   move to end



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/resources/jdbc_mysql_source_and_sink_parallel.conf:
##########
@@ -45,12 +45,12 @@ sink {
         user = "root"
         password = "Abc!@#135_seatunnel"
         connection_check_timeout_sec = 100
-        query = """insert into sink (c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,
+        query = """insert into sink (c_bigint_30,c_decimal_unsigned_30,c_decimal_30,c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,

Review Comment:
   move to end



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/resources/jdbc_mysql_source_and_sink.conf:
##########
@@ -42,12 +42,12 @@ sink {
         user = "root"
         password = "Abc!@#135_seatunnel"
 
-        query = """insert into sink (c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,
+        query = """insert into sink (c_bigint_30,c_decimal_unsigned_30,c_decimal_30,c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,

Review Comment:
   move to end



##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -64,47 +64,50 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
     private static final String CREATE_SQL =
             "CREATE TABLE IF NOT EXISTS %s\n"
                     + "(\n"
-                    + "    `c_bit_1`              bit(1)                DEFAULT NULL,\n"
-                    + "    `c_bit_8`              bit(8)                DEFAULT NULL,\n"
-                    + "    `c_bit_16`             bit(16)               DEFAULT NULL,\n"
-                    + "    `c_bit_32`             bit(32)               DEFAULT NULL,\n"
-                    + "    `c_bit_64`             bit(64)               DEFAULT NULL,\n"
-                    + "    `c_boolean`            tinyint(1)            DEFAULT NULL,\n"
-                    + "    `c_tinyint`            tinyint(4)            DEFAULT NULL,\n"
-                    + "    `c_tinyint_unsigned`   tinyint(3) unsigned   DEFAULT NULL,\n"
-                    + "    `c_smallint`           smallint(6)           DEFAULT NULL,\n"
-                    + "    `c_smallint_unsigned`  smallint(5) unsigned  DEFAULT NULL,\n"
-                    + "    `c_mediumint`          mediumint(9)          DEFAULT NULL,\n"
-                    + "    `c_mediumint_unsigned` mediumint(8) unsigned DEFAULT NULL,\n"
-                    + "    `c_int`                int(11)               DEFAULT NULL,\n"
-                    + "    `c_integer`            int(11)               DEFAULT NULL,\n"
-                    + "    `c_bigint`             bigint(20)            DEFAULT NULL,\n"
-                    + "    `c_bigint_unsigned`    bigint(20) unsigned   DEFAULT NULL,\n"
-                    + "    `c_decimal`            decimal(20, 0)        DEFAULT NULL,\n"
-                    + "    `c_decimal_unsigned`   decimal(38, 18)       DEFAULT NULL,\n"
-                    + "    `c_float`              float                 DEFAULT NULL,\n"
-                    + "    `c_float_unsigned`     float unsigned        DEFAULT NULL,\n"
-                    + "    `c_double`             double                DEFAULT NULL,\n"
-                    + "    `c_double_unsigned`    double unsigned       DEFAULT NULL,\n"
-                    + "    `c_char`               char(1)               DEFAULT NULL,\n"
-                    + "    `c_tinytext`           tinytext,\n"
-                    + "    `c_mediumtext`         mediumtext,\n"
-                    + "    `c_text`               text,\n"
-                    + "    `c_varchar`            varchar(255)          DEFAULT NULL,\n"
-                    + "    `c_json`               json                  DEFAULT NULL,\n"
-                    + "    `c_longtext`           longtext,\n"
-                    + "    `c_date`               date                  DEFAULT NULL,\n"
-                    + "    `c_datetime`           datetime              DEFAULT NULL,\n"
-                    + "    `c_timestamp`          timestamp NULL        DEFAULT NULL,\n"
-                    + "    `c_tinyblob`           tinyblob,\n"
-                    + "    `c_mediumblob`         mediumblob,\n"
-                    + "    `c_blob`               blob,\n"
-                    + "    `c_longblob`           longblob,\n"
-                    + "    `c_varbinary`          varbinary(255)        DEFAULT NULL,\n"
-                    + "    `c_binary`             binary(1)             DEFAULT NULL,\n"
-                    + "    `c_year`               year(4)               DEFAULT NULL,\n"
-                    + "    `c_int_unsigned`       int(10) unsigned      DEFAULT NULL,\n"
-                    + "    `c_integer_unsigned`   int(10) unsigned      DEFAULT NULL\n"
+                    + "    `c_bigint_30`            BIGINT(40)  unsigned  DEFAULT NULL,\n"
+                    + "    `c_decimal_unsigned_30`  DECIMAL(30) unsigned  DEFAULT NULL,\n"
+                    + "    `c_decimal_30`           DECIMAL(30)           DEFAULT NULL,\n"

Review Comment:
   move to end



-- 
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] [incubator-seatunnel] hailin0 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -60,7 +60,8 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
             Lists.newArrayList(
                     "/jdbc_mysql_source_and_sink.conf",
                     "/jdbc_mysql_source_and_sink_parallel.conf",
-                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf");
+                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf",
+                    "/jdbc_mysql_source_and_sink_bu_parallel_upper_lower.conf");

Review Comment:
   What is `bu`?



-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   > > From the design perspective, it is necessary to support any DecimalType with scale=0. Otherwise, DecimalType(20,0), DecimalType(30,0), etc., will need to be modified. So it's better to do it well in one go
   > 
   > <img alt="image" width="1422" src="https://user-images.githubusercontent.com/76689593/233887127-3ae67dcb-7b2c-431d-bf83-2c09c4427c3a.png">
   > 
   > I have checked that Flink also uses Long type for storage. I think we do not need to change it for the time being CC @hailin0 @ic4y
   
   If Flink also supports bigint(20), it might have a similar issue.


-- 
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] zhilinli123 closed pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 closed pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column 
URL: https://github.com/apache/seatunnel/pull/4634


-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Hotfix][Connector-V2][Jdbc] Fix Mysql bigint(20) unsigned cannot be used as a partition_column bug

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

   The current partition range is processed using Long, and bigint(20) will cause overflow, so it is necessary to modify the `PartitionParameter` related classes.


-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   I have solved some code conflicts, please help to open CI, thank you
   


-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source] Support for Decimal types as splict keys

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

   > update title
   in this way?
   
   


-- 
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 merged pull request #4634: [Improve][Connector-V2][Jdbc-Source] Support for Decimal types as splict keys

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


-- 
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] [incubator-seatunnel] zhilinli123 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1173397833


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -60,7 +60,8 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
             Lists.newArrayList(
                     "/jdbc_mysql_source_and_sink.conf",
                     "/jdbc_mysql_source_and_sink_parallel.conf",
-                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf");
+                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf",
+                    "/jdbc_mysql_source_and_sink_bu_parallel_upper_lower.conf");

Review Comment:
   ` BIGINT unsigned` abbreviate



-- 
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] [incubator-seatunnel] zhilinli123 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1191266675


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -194,11 +196,14 @@ Pair<String[], List<SeaTunnelRow>> initTestData() {
                 };
 
         List<SeaTunnelRow> rows = new ArrayList<>();
+        // Define a large bigint data value to test for compatibility above bigint(20)
+        BigDecimal testBigDecimalValue = new BigDecimal("2844674407371055000");
         for (int i = 0; i < 100; i++) {
             byte byteArr = Integer.valueOf(i).byteValue();
             SeaTunnelRow row =
                     new SeaTunnelRow(
                             new Object[] {
+                                testBigDecimalValue.add(BigDecimal.valueOf(i)),

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

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


[GitHub] [incubator-seatunnel] zhilinli123 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1198789796


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/resources/jdbc_mysql_source_and_sink_parallel.conf:
##########
@@ -45,12 +45,12 @@ sink {
         user = "root"
         password = "Abc!@#135_seatunnel"
         connection_check_timeout_sec = 100
-        query = """insert into sink (c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,
+        query = """insert into sink (c_bigint_30,c_decimal_unsigned_30,c_decimal_30,c_bit_1, c_bit_8, c_bit_16, c_bit_32, c_bit_64, c_boolean, c_tinyint, c_tinyint_unsigned, c_smallint, c_smallint_unsigned,

Review Comment:
   Thanks for checking. I fixed it
   @hailin0 



-- 
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] [incubator-seatunnel] ic4y commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   Please update the document
   ```
   partition_column [string]
   The column name for parallelism's partition, only support numeric type.
   ```


-- 
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] [incubator-seatunnel] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   This is the document for now
   


-- 
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] [incubator-seatunnel] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   > Currently, there are two issues that need further discussion
   > 
   > 1、The design needs to support any DecimalType with scale=0, instead of bigint(20). 2、Need to resolve the overflow issue of using Long to store partition boundaries
   
   @TyrantLucifer @TaoZex @EricJoy2048 @hailin0 @Hisoka-X All bosses have time to help look at this thanks
   


-- 
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] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   PTAL:@EricJoy2048 @hailin0  thks


-- 
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 pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Compatible Mysql bigint(20) used as a partition_column

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

   update title


-- 
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] [incubator-seatunnel] zhilinli123 commented on pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

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

   > From the design perspective, it is necessary to support any DecimalType with scale=0. Otherwise, DecimalType(20,0), DecimalType(30,0), etc., will need to be modified. So it's better to do it well in one go
   
   <img width="1422" alt="image" src="https://user-images.githubusercontent.com/76689593/233887127-3ae67dcb-7b2c-431d-bf83-2c09c4427c3a.png">
   I have checked that Flink also uses Long type for storage. I think we do not need to change it for the time being
   CC @hailin0 @ic4y 


-- 
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] [incubator-seatunnel] zhilinli123 commented on a diff in pull request #4634: [Improve][Connector-V2][Jdbc-Source]Support Mysql bigint(20) used as a partition_column

Posted by "zhilinli123 (via GitHub)" <gi...@apache.org>.
zhilinli123 commented on code in PR #4634:
URL: https://github.com/apache/incubator-seatunnel/pull/4634#discussion_r1173604582


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/connector-jdbc-e2e-part-1/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcMysqlIT.java:
##########
@@ -60,7 +60,8 @@ public class JdbcMysqlIT extends AbstractJdbcIT {
             Lists.newArrayList(
                     "/jdbc_mysql_source_and_sink.conf",
                     "/jdbc_mysql_source_and_sink_parallel.conf",
-                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf");
+                    "/jdbc_mysql_source_and_sink_parallel_upper_lower.conf",
+                    "/jdbc_mysql_source_and_sink_bu_parallel_upper_lower.conf");

Review Comment:
   > sorry for my oversight
   



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