choucmei opened a new issue, #4732: URL: https://github.com/apache/incubator-seatunnel/issues/4732
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues. ### What happened JDBC Source lost data,when the data of partition_column is null. https://github.com/apache/incubator-seatunnel/blob/b09d379489bc906fa5916334ed5d4190e9a1125f/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactory.java#L152 Function of max() and min() will ignore the null . https://github.com/apache/incubator-seatunnel/blob/b09d379489bc906fa5916334ed5d4190e9a1125f/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceFactory.java#L115 May be consider the first part `"SELECT * FROM (%s) tt where %s <= ?" ` and las part `"SELECT * FROM (%s) tt where %s >= ?" ` or add others part ` "SELECT * FROM (%s) tt where %s > max or %s < min ?",` ### SeaTunnel Version 2.3.1-SNAPSHOT ### SeaTunnel Config ```conf # # 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. # env { execution.parallelism = 3 job.mode = "BATCH" } source{ jdbc{ url = "jdbc:mysql://mysql-e2e:3306/seatunnel" driver = "com.mysql.cj.jdbc.Driver" user = "root" password = "Abc!@#135_seatunnel" query = "select * from source" partition_column = "c_integer" partition_num = 3 result_table_name = "jdbc" } } transform { } sink { jdbc { url = "jdbc:mysql://mysql-e2e:3306/seatunnel" driver = "com.mysql.cj.jdbc.Driver" 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, c_mediumint, c_mediumint_unsigned, c_int, c_integer, c_bigint, c_bigint_unsigned, c_decimal, c_decimal_unsigned, c_float, c_float_unsigned, c_double, c_double_unsigned, c_char, c_tinytext, c_mediumtext, c_text, c_varchar, c_json, c_longtext, c_date, c_datetime, c_timestamp, c_tinyblob, c_mediumblob, c_blob, c_longblob, c_varbinary, c_binary, c_year, c_int_unsigned, c_integer_unsigned) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);""" } } ``` ### Running Command ```shell /tmp/seatunnel/bin/start-seatunnel-flink-15-connector-v2.sh --config /tmp/jdbc_mysql_source_and_sink.conf ``` ### Error Exception ```log No Exception ``` ### Flink or Spark Version _No response_ ### Java or Scala Version JDK1.8 ### Screenshots _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
