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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to