sharpca opened a new issue, #13079: URL: https://github.com/apache/seatunnel/issues/13079
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues. - [X] I searched the open and closed pull requests for the affected classes and for locale dependent type mapping. ### What happened The JDBC dialect type converters match the source column type against the dialect type constants with `String.toUpperCase()` / `String.toLowerCase()` **without** `Locale.ROOT`. The result therefore depends on the JVM default locale. In a Turkish or Azerbaijani locale `"i"` is upper-cased to `"İ"` (`U+0130`), so a type name such as `INTEGER` becomes `İNTEGER` and no longer matches the constant. The converter then falls through to its default branch and the job fails with an unsupported type error instead of mapping the column. The following converters are affected in `dev`: | Dialect | Converter | Type name that breaks | | --- | --- | --- | | DB2 | `DB2TypeConverter` | `INTEGER`, `BIGINT`, `SMALLINT`, `BINARY` | | DaMeng | `DmdbTypeConverter` | `INT`, `INTEGER`, `BIGINT`, `SMALLINT` | | IRIS | `IrisTypeConverter` | `INT`, `INTEGER`, `BIGINT`, `SERIAL` | | Kingbase | `KingbaseTypeConverter` | `INT`, `INTEGER`, `BIGINT` | | Oracle | `OracleTypeConverter` | `INTEGER`, `INTERVAL`, `BINARY_FLOAT` | | PostgreSQL | `PostgresTypeConverter` | `INT4`, `INT8`, `BIGSERIAL` | | Redshift | `RedshiftTypeConverter` | `INT`, `BIGINT`, `SMALLINT` | | SAP HANA | `SapHanaTypeConverter` | `INT`, `INTEGER`, `BIGINT` | | Xugu | `XuguTypeConverter` | `INT`, `INTEGER`, `BIGINT`, `TINYINT` | | YashanDB | `YashanDbTypeConverter` | `INT`, `INTEGER`, `BIGINT`, `SMALLINT` | `PostgresTypeConverter` lower-cases the type name, so it only breaks when the type name contains an upper-case `I` (`INT4` -> `ınt4`). The MySQL, OceanBase and SQL Server converters are already covered by #13076 and #13077, and `JdbcDialect` / `CatalogUtils` by #13063, so they are not part of this report. ### What you expected to happen A JDBC dialect type converter maps the same source type to the same SeaTunnel type on every worker, regardless of the JVM default locale of that worker. ### SeaTunnel Version dev ### SeaTunnel Config Not configuration dependent; the reproduction uses the affected type converters directly. ### Running Command ```shell ./mvnw -pl seatunnel-connectors-v2/connector-jdbc \ -Dtest='Db2TypeConverterTest,DmdbTypeConverterTest,IrisTypeConverterTest,\ KingbaseTypeConverterTest,OracleTypeConverterTest,PostgresTypeConverterTest,\ RedshiftTypeConverterTest,SapHanaTypeConverterTest,XuguTypeConverterTest,\ YashanDbTypeConverterTest' test ``` ### Error Exception ```text java.lang.RuntimeException: Unsupported type INT at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.db2.DB2TypeConverter.convert(DB2TypeConverter.java:...) ``` ### Zeta or Flink or Spark Version Not engine specific. The failure is in the JDBC connector. ### Java or Scala Version Not version specific. Reproduced on JDK 17 with `-Duser.language=tr -Duser.country=TR`. ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's Code of Conduct. -- 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]
