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

   ## What is the purpose of the pull request
   
   This PR addresses HUDI-96 / #14477: launching Spark applications from 
hudi-cli currently relies on positional arguments, which are error-prone (e.g. 
BOOTSTRAP pushes 21 positional values through `SparkMain.addAppArgs` and any 
misalignment silently breaks the invocation).
   
   ## Brief change log
   
   - `SparkMain` gains a named-argument form: `--command/--master/--memory` 
plus per-command `-Dkey=value` pairs (JCommander), translated to the existing 
positional protocol before dispatch.
   - `SparkCommand` enum now declares the canonical argument names for each 
command, single source of truth for both the translator and call sites.
   - Added `SparkMain.addNamedAppArgs(SparkLauncher, SparkCommand, master, 
memory, String... kvPairs)`, used by all 12 hudi-cli call sites (Bootstrap, 
Compaction, Clustering, Cleans, Repairs, Savepoints, Rollbacks, Markers, 
ArchivedCommits, UpgradeOrDowngrade). Launcher invocations are now 
self-describing and robust to argument misalignment.
   - `com.beust:jcommander` declared as an explicit hudi-cli dependency 
(already managed in the root pom).
   - Known components using hudi-cli parser API of SparkCommand (e.g. 
transitive usages) keep working: `IMPORT`/`UPSERT` were deprecated commands and 
intentionally have no named mapping; named form is optional with legacy 
positional form still fully supported.
   
   ## Verify this pull request
   
   - [ ] This change was already covered by tests, or added new tests (N/A: no 
SparkMain tests exist; existing hudi-cli tests unaffected)
   - [ ] This pull request added new features (no)
   
   ## Committer checklist
   
   - [x] Has a corresponding JIRA in PR title & commit (HUDI-96)
   - [x] Commit message is descriptive of the change
   - [x] CI is green (or in progress; local build network-limited, see note)
   
   **Note on local verification**: a full `mvn -pl hudi-cli -am compile` was 
attempted locally but the hudi dependency chain (hudi-gcp library BOM downloads 
from Maven Central) is blocked by local network conditions; compilation is left 
to CI. The change is type-checked by hand: every call-site variable passed into 
`addNamedAppArgs` is a `String` (shell option values), and 
`addAppArgs(String...)` varargs signature was verified against the bundled 
spark-launcher jar.


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