You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "hutiefang76 (via GitHub)" <gi...@apache.org> on 2026/09/27 23:13:34 UTC

[I] [Bug][JDBC] DuckDB unsigned integers silently wrap in Source [seatunnel]

hutiefang76 opened a new issue, #12507:
URL: https://github.com/apache/seatunnel/issues/12507

   ### Description
   
   DuckDB JDBC Source silently wraps unsigned integer values outside the corresponding signed range. With DuckDB JDBC 1.3.1, a real JdbcSourceFactory run reads each of these as -1:
   
   | DuckDB type | Input | SeaTunnel output |
   | --- | --- | --- |
   | UTINYINT | 255 | -1 |
   | USMALLINT | 65535 | -1 |
   | UINTEGER | 4294967295 | -1 |
   | UBIGINT | 18446744073709551615 | -1 |
   
   The driver's getObject reads all four correctly. DuckDBTypeConverter currently maps them to BYTE, SHORT, INT and LONG respectively. The documented DuckDB source mapping instead lists SMALLINT, INT, BIGINT and DECIMAL(20,0). Existing Source/Sink tests use small unsigned values and miss the overflow.
   
   ### Reproduction
   
   Create a DuckDB table with these four column types and insert the values above. Read it with JDBC source using driver org.duckdb.DuckDBDriver and table_path main.<table>. The inferred schema narrows the values during ResultSet conversion.
   
   ### Expected behavior
   
   Preserve the complete unsigned range with wider inferred types. Signed integer mappings should remain unchanged. I have a focused fix and a regression covering upper boundaries, zero, null, and round trips into precreated and catalog-generated tables.
   


-- 
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.apache.org

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


Re: [I] [Bug][JDBC] DuckDB unsigned integers silently wrap in Source [seatunnel]

Posted by "hutiefang76 (via GitHub)" <gi...@apache.org>.
hutiefang76 commented on issue #12507:
URL: https://github.com/apache/seatunnel/issues/12507#issuecomment-5863236875

   Thanks for reviewing the boundary cases. The fix and regressions are already in #12508, which references this issue. I reproduced it on `dev` at 146a1b5c510e1c33010a92981ae1afc8139c624b with `duckdb_jdbc` 1.3.1.0; the fix is 22e5f03fe. This was a source checkout, rather than a released SeaTunnel binary. I haven’t verified an older release branch yet, so I can’t name an affected release for backporting from this evidence alone.
   
   The PR keeps signed mappings unchanged and covers unsigned boundaries, zero/null, precreated unsigned targets, and catalog-created targets. The affected 17 tests and module verify passed on JDK 8 and 17.
   


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


Re: [I] [Bug][JDBC] DuckDB unsigned integers silently wrap in Source [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #12507:
URL: https://github.com/apache/seatunnel/issues/12507#issuecomment-5869542318

   Classification: A / Connector-V2 DuckDB unsigned type conversion.
   
   The reported dev reproduction and #12508 now agree on the required mapping boundary: UTINYINT, USMALLINT, and UINTEGER widen by one signed type, while UBIGINT becomes DECIMAL(20,0); signed mappings remain unchanged. I checked that the PR also asserts the UBIGINT precision and scale and exercises boundary, null, pre-created-target, and generated-target round trips. The EN/ZH source documentation and incompatible-change entries are necessary because inferred schemas become wider.
   
   The evidence is only against dev, so it does not establish an affected release or a backport target. #12508 is still open with Build in progress and BLOCKED, therefore the issue remains open. Please wait for that Build and review rather than opening a parallel conversion PR.
   
   No label or assignment change in this pass.


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


Re: [I] [Bug][JDBC] DuckDB unsigned integers silently wrap in Source [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12507:
URL: https://github.com/apache/seatunnel/issues/12507#issuecomment-5862579362

   Thanks for the clear report and boundary table. Since you already have a fix and a regression covering the upper boundaries, zero, null, and round trips into precreated and catalog-generated tables, please open a PR referencing this issue. Widening the unsigned mappings to SMALLINT/INT/BIGINT/DECIMAL(20,0) to match the documented DuckDB source mapping sounds like the right direction, and keeping the signed integer mappings unchanged is good.
   
   Could you also confirm which SeaTunnel version you reproduced this on? That will help decide whether the fix should be backported.
   
   <!-- streview-comment:1374 -->


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