sharpca opened a new issue, #13080:
URL: https://github.com/apache/seatunnel/issues/13080

   ### Search before asking
   
   - [X] I had searched in the issues and found no similar issues.
   
   ### What happened
   
   The CLI converts enum-valued arguments with `String#toUpperCase()` / 
`String#toLowerCase()` without a locale before matching them against the enum 
constants, so the result depends on the JVM default locale. Under a Turkish or 
Azerbaijani locale, `client` upper-cases to `CLİENT` (dotted capital I) and 
`sink` to `SİNK`, which are not enum names.
   
   Affected conversions:
   
   | Module | Argument | Under `tr-TR` |
   | --- | --- | --- |
   | `seatunnel-spark-starter-common` | `--deploy-mode client` | 
`IllegalArgumentException: No enum constant ...DeployMode.CLİENT` |
   | `seatunnel-flink-starter-common` | `--deploy-mode run-application` | 
`IllegalArgumentException: No enum constant ...DeployMode.RUN_APPLİCATİON` |
   | `seatunnel-flink-starter-common` | `--target yarn-session` / 
`kubernetes-application` | `IllegalArgumentException: No enum constant 
...MasterType.YARN_SESSİON` |
   | `seatunnel-starter` | `seatunnel-connector.sh -pt sink` | reports "only 
support these options: [source, sink, transform]" although `sink` was passed |
   | `seatunnel-starter` | `--metadata-export -pt sink` | reports "Plugin type 
must be one of: [source, sink, transform]" |
   
   `DeployMode.from(String)` has the same default-locale conversion and 
additionally throws a `NullPointerException` for a `null` argument.
   
   ### What you expected to happen
   
   CLI enum arguments are parsed identically under any JVM default locale.
   
   ### SeaTunnel Version
   
   dev, verified at commit `fcb404cd947da03a712c4ae9ee9068744bd946a5`.
   
   ### SeaTunnel Config
   
   Not configuration dependent; the failure happens while the command line 
arguments are parsed.
   
   ### Running Command
   
   ```shell
   JAVA_TOOL_OPTIONS="-Duser.language=tr -Duser.country=TR" ./bin/seatunnel.sh 
-m local -c config/v2.batch.config.template
   # or, with the Spark starter:
   JAVA_TOOL_OPTIONS="-Duser.language=tr -Duser.country=TR" 
./bin/start-seatunnel-spark-3-connector-v2.sh --deploy-mode client
   ```
   
   ### Error Exception
   
   ```log
   java.lang.IllegalArgumentException: No enum constant 
org.apache.seatunnel.common.config.DeployMode.CLİENT
   ```
   
   ### Zeta or Flink or Spark Version
   
   Not engine specific: the conversion happens in the starters that are shared 
by all engines.
   
   ### Java or Scala Version
   
   Not version specific, reproduced on JDK 17.
   
   ### 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](https://www.apache.org/foundation/policies/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]

Reply via email to