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

   ### Purpose of this pull request
   
   Fixes #12590. Preserve unknown DuckDB BIT/ENUM string lengths instead of 
substituting 1/255. MySQL automatic DDL can then choose LONGTEXT and accept 
valid source values. Positive lengths and unrelated fallback mappings are 
preserved, including ENUM array declarations.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Previously, a five-bit value or a 400-character ENUM label could 
produce VARCHAR(1)/VARCHAR(255) in MySQL and fail with SQLState 22001. Unknown 
lengths now remain unspecified. Existing destination tables are not resized 
automatically; this is explained in the EN/ZH source docs.
   
   ### How was this patch tested?
   
   * The original converter failed seven assertions in 63 tests. Native DuckDB 
catalog metadata plus the production MySQL DDL builder reproduced two actual 
MySQL 8.0.43 length errors; LONGTEXT controls accepted the values and NULL.
   * On JDK 8 and 17, 117 focused tests passed: DuckDB converter/catalog, MySQL 
converter and DDL builder. The catalog regression checks real BIT/long ENUM 
metadata and generated LONGTEXT columns.
   * Existing JdbcMysqlIT#testDuckDbUnboundedStringAutoDdl passed (one executed 
test, no skip), with exact value/null read-back.
   * An additional actual DuckDB SourceFactory → MySQL SinkFactory run, with 
the save-mode handler applied before writing, automatically created the 
destination and read back the exact five-bit value, 400-character label and 
NULL row (two rows total). This is a native host flow, not the full engine E2E 
matrix.
   * Scoped Spotless, affected reactor `-DskipTests verify` and four 
MarkdownTest checks passed.
   
   ```sh
   ./mvnw -pl seatunnel-connectors-v2/connector-jdbc -am -DskipIT=true 
-Dtest=DuckDBTypeConverterTest,DuckDBCatalogTest,MySqlTypeConverterTest,MysqlCreateTableSqlBuilderTest
 -Dsurefire.failIfNoSpecifiedTests=false verify
   ```
   
   ### Check list
   
   * [ ] New JAR license/notice changes (not applicable; no new dependencies)
   * [x] Updated user documentation
   * [ ] Connector registration/distribution/config changes (not applicable; 
existing connector)
   * [ ] Incompatible changes (STRING mapping retained; existing tables are not 
altered)
   
   AI disclosure: DeepSeek and Codex assisted the implementation, tests and 
this PR description.
   


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