zhang-arvin opened a new pull request, #11860:
URL: https://github.com/apache/seatunnel/pull/11860

   ## Purpose
   
   Fixes #11688.
   
   `DmdbTypeConverter` handles `CHAR`, `CHARACTER`, `VARCHAR`, `VARCHAR2` and 
`NVARCHAR`, but not `NCHAR`. Reading a Dameng table that contains `NCHAR` 
columns falls through to the `default` branch and throws:
   
   ```
   ErrorCode:[COMMON-17], ErrorDescription:['Dameng' unsupported convert type 
'nchar' of 'test' to SeaTunnel data type.]
   ```
   
   `NCHAR` is the fixed-length national character type, and the counterpart of 
the already supported variable-length `NVARCHAR`. Supporting `NVARCHAR` but not 
`NCHAR` is an oversight.
   
   ## Changes
   
   - Added `DM_NCHAR = "NCHAR"` constant in `DmdbTypeConverter`
   - Added `case DM_NCHAR:` in the `convert` method, mapping to `STRING` type 
with `charTo4ByteLength` for column length (same treatment as other 
fixed-length character types)
   - Added `testConvertNchar` unit test in `DmdbTypeConverterTest`
   
   ## Testing
   
   ```
   ./mvnw test -pl seatunnel-connectors-v2/connector-jdbc 
-Dtest=DmdbTypeConverterTest
   Tests run: 35, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   ## Checklist
   
   - [x] No new dependency added
   - [x] No documentation change needed (type mapping is internal)
   - [x] Backward compatible
   - [x] Spotless formatting applied


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