Skip to content

Conversation

heyihong
Copy link
Contributor

@heyihong heyihong commented Aug 20, 2025

What changes were proposed in this pull request?

Refactored RegisterUserDefinedDataSource handling in SparkConnectPlanner to make it side effect free by converting it from a direct handler to a command transformation that returns a LogicalPlan.

Key changes:

  • Created RegisterUserDefinedDataSource to encapsulate user-defined data source registration logic
  • Moved REGISTER_DATA_SOURCE case from process method to transformCommand method
  • Renamed handleRegisterUserDefinedDataSource to transformRegisterUserDefinedDataSource to return LogicalPlan instead of performing side effects

Why are the changes needed?

The previous implementation created side effects in SparkConnectPlanner by directly registering functions. This refactoring makes user-defined data source registration consistent with other commands by deferring the registration to logical plan execution.

Does this PR introduce any user-facing change?

No. This is an internal refactoring that maintains the same external behavior. User-defined data source registration continues to work exactly as before.

How was this patch tested?

Existing tests

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Cursor 1.4.5

@heyihong heyihong changed the title [WIP[SPARK-53321] Make RegisterUserDefinedDataSource in SparkConnectPlanner side effect free [WIP][SPARK-53321] Make RegisterUserDefinedDataSource in SparkConnectPlanner side effect free Aug 20, 2025
@heyihong heyihong changed the title [WIP][SPARK-53321] Make RegisterUserDefinedDataSource in SparkConnectPlanner side effect free [SPARK-53321] Make RegisterUserDefinedDataSource in SparkConnectPlanner side effect free Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant