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

   ### Purpose of this pull request
   
   Fixes #6916.
   
   The JDBC fixed chunk splitter converted `DATE` partition bounds to numeric 
values and later bound those values as `BigDecimal`. JDBC drivers either reject 
that conversion or compare the `DATE` column with a numeric parameter 
incorrectly, which can make every generated split return zero rows.
   
   This patch performs `DATE` range arithmetic in epoch days and converts 
generated split boundaries back to `java.sql.Date` before binding them. Numeric 
partition columns keep the existing `BigDecimal` behavior.
   
   Unlike the closed approach in #6917, this change does not convert every 
integral `BigDecimal` parameter to a timestamp, so numeric partition columns 
are unaffected.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. JDBC source fixed splitting now binds `DATE` partition boundaries with 
`PreparedStatement#setDate`, allowing `DATE` partition columns to return the 
expected rows.
   
   ### How was this patch tested?
   
   Added unit coverage for generated `DATE` split boundaries and JDBC parameter 
binding.
   
   ```shell
   ./mvnw -pl seatunnel-connectors-v2/connector-jdbc \
     -DfailIfNoTests=false \
     -Dtest=FixedChunkSplitterTest test
   ```
   
   Result: 6 tests run, 0 failures, 0 errors, 0 skipped.
   
   ### Check list
   
   * [x] No new Jar binary package is added.
   * [x] No documentation update is required; this fixes existing documented 
`DATE` partition-column support.
   * [x] No incompatible change is introduced.
   * [x] No new connector is added, so plugin mapping, distribution POM, 
labels, plugin config, and new-connector E2E updates are not applicable.
   


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