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/28 17:25:26 UTC
[PR] [Fix][Connector-V2] Use native DuckDB query type metadata [seatunnel]
hutiefang76 opened a new pull request, #12543:
URL: https://github.com/apache/seatunnel/pull/12543
### Purpose of this pull request
DuckDB Source queries currently use the generic JDBC type-code converter: DECIMAL(20,0) becomes BIGINT, zoned timestamps become TIMESTAMP, and UUID/JSON/complex types fail discovery. Use the existing DuckDB mapper for query metadata, following the other database catalogs.
Fixes #12542.
### Does this PR introduce any user-facing change?
Yes. Query discovery preserves native DECIMAL precision/scale and TIMESTAMP_TZ, and reads UUID/JSON/INTERVAL/ARRAY/STRUCT/MAP as STRING through the existing converter. Collection detection precedes scalar DECIMAL normalization, so DECIMAL(p,s)[] remains STRING. Column aliases, native source type, nullability and decimal scale are retained.
EN/ZH Source docs and incompatible-change notes explain the corrected output types and explicit SQL casts for downstream compatibility. Complex STRING values are driver text rather than nested SeaTunnel values; raw STRUCT text is not a valid native STRUCT input in JDBC1.3.1. The documented `to_json` projection was verified against a pre-created Lake target.
`table_path` discovery is unchanged. No new options, dependencies, row serializers or standalone DuckLake connector.
### How was this patch tested?
- Extended existing DuckDBCatalogTest and DuckDBSourceAndSinkTest. Against original production code: 13 tests, two failures and two unsupported-type errors; corrected connection setup closes the write connection before readonly Source discovery.
- Verified the DECIMAL-array regression independently (STRING expected, DECIMAL(0,0) observed before collection-order correction).
- JDK8 and JDK17 each: 89 tests, zero failures/errors/skips, with clean connector-jdbc `verify`:
```shell
mvn -q -o -pl seatunnel-connectors-v2/connector-jdbc '-Dtest=DuckDB*Test,JdbcFieldTypeUtilsTest' clean verify
```
- Actual Source reads a value beyond signed BIGINT range, a microsecond timestamp instant, UUID/JSON/ARRAY/STRUCT/MAP text, a decimal expression, aliases and nulls. Existing table-path Source/Sink and ordinary catalog tests still pass.
- DuckDB JDBC1.3.1 + real DuckLake extension, SQLite metadata/local data: query Source → explicit JDBC insert → independent reconnect passes decimal, zero-scale decimal, date, timestamp, zoned timestamp, UUID, JSON, BLOB, ARRAY and MAP. STRUCT succeeds with the documented `to_json` projection; unnormalized driver text fails native STRUCT insertion.
- Spotless and official MarkdownTest (4/4) pass. No existing DuckDB engine IT was found; this uses the existing real-JDBC factory flow tests and an additional Lake smoke probe.
These are representative local cases, not a claim of CDC, commit deduplication, cross-host recovery or performance acceptance. Remote CI and review are pending.
### Check list
- [x] EN/ZH Source documentation updated.
- [x] EN/ZH incompatible-change notes and migration guidance added.
- [x] Existing connector tests extended; no new dependencies or connector registration needed.
--
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: [PR] [Fix][Connector-V2] Use native DuckDB query type metadata [seatunnel]
Posted by "hutiefang76 (via GitHub)" <gi...@apache.org>.
hutiefang76 commented on PR #12543:
URL: https://github.com/apache/seatunnel/pull/12543#issuecomment-5876522313
Closing this for now after checking the adjacent timestamp and unsigned query types.
On JDBC 1.3.1.0, `TIMESTAMP_S`, `TIMESTAMP_MS`, and `TIMESTAMP_NS` all report JDBC `TIMESTAMP`. The existing query path returns `TIMESTAMP`/`LocalDateTime`, but this mapper sends their native names to the converter's STRING fallback, changing the schema and the actual row values to strings. Also, this PR on its own narrows `UTINYINT` query output from SMALLINT to TINYINT; it needs the unsigned converter fix in #12508.
The UUID/JSON/DECIMAL tests covered the reported failures, but missed these regressions in previously working queries. I will keep this withdrawn until the existing mappings are preserved and the dependency is resolved. Thanks for reviewing.
--
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: [PR] [Fix][Connector-V2] Use native DuckDB query type metadata [seatunnel]
Posted by "hutiefang76 (via GitHub)" <gi...@apache.org>.
hutiefang76 closed pull request #12543: [Fix][Connector-V2] Use native DuckDB query type metadata
URL: https://github.com/apache/seatunnel/pull/12543
--
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