Skip to content

[spark] Add input argument validation with friendly errors to CALL procedure framework#3689

Open
XuQianJin-Stars wants to merge 1 commit into
apache:mainfrom
XuQianJin-Stars:feat/spark-procedure-arg-validation
Open

[spark] Add input argument validation with friendly errors to CALL procedure framework#3689
XuQianJin-Stars wants to merge 1 commit into
apache:mainfrom
XuQianJin-Stars:feat/spark-procedure-arg-validation

Conversation

@XuQianJin-Stars

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #xxx

Introduce reusable input-argument validation helpers in the Spark CALL procedure base class so that procedures fail fast with clear, user-facing error messages when a required parameter is missing or its type does not match the declared parameter spec.

Brief change log

  • Added two reusable validation helpers in BaseProcedure:
    • checkRequiredArgument(parameter, provided): throws an IllegalArgumentException with a descriptive message when a required parameter is not supplied.
    • checkArgumentType(parameter, value): throws an IllegalArgumentException when the supplied value's type does not match the declared parameter type.
  • GetClusterConfigsProcedure.call now invokes these helpers to validate the config_keys array parameter before execution.
  • Added a negative test (GetClusterConfigsProcedureTest) asserting a type-mismatched argument is rejected.

Tests

  • GetClusterConfigsProcedureTest:
    • get_cluster_configs: rejects wrong argument type for config_keys — verifies that passing a scalar STRING where an ARRAY is expected fails with a friendly error instead of a cryptic internal failure.

API and Format

  • No public API or storage format change. Validation is internal to the procedure framework; only the failure mode (error message) for invalid input is improved.

Documentation

  • No documentation change required. Behavior is backward compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant