SparkConnectPlanner¶
Creating Instance¶
SparkConnectPlanner takes the following to be created:
- SessionHolder
- ExecuteHolder (default: undefined)
SparkConnectPlanner is created when:
ExecuteThreadRunneris requested to handle a commandSparkConnectPlanExecutionis requested to handle a planMLUtilsis requested toparseRelationProtoSparkConnectAnalyzeHandleris requested to process an analyze plan request
transformRelation¶
transformRelation...FIXME
transformRelation is used when:
SparkConnectPlanExecutionis requested to handlePlanSparkConnectPlanneris requested to do many thingsSparkConnectAnalyzeHandleris requested to process a request
Handle Plugins for Spark Connect Relation Types¶
transformRelationPlugin...FIXME
transformMapPartitions¶
transformMapPartitions...FIXME
transformPythonUDF¶
transformPythonUDF creates a PythonUDF (based on the given fun and transformPythonFunction).
transformPythonUDF is used when:
SparkConnectPlanneris requested to transformMapPartitions, transformGroupMap, transformCoGroupMap, transformCommonInlineUserDefinedFunction
transformPythonFunction¶
transformPythonFunction...FIXME
transformPythonFunction is used when:
SparkConnectPlanneris requested to transformPythonUDF and handleRegisterPythonUDF
Process Command¶
process(
command: proto.Command,
responseObserver: StreamObserver[ExecutePlanResponse],
executeHolder: ExecuteHolder): Unit
process handles the input Command based on its type.
| Command Type | Handler |
|---|---|
REGISTER_FUNCTION | handleRegisterUserDefinedFunction |
REGISTER_TABLE_FUNCTION | handleRegisterUserDefinedTableFunction |
WRITE_OPERATION | handleWriteOperation |
CREATE_DATAFRAME_VIEW | handleCreateViewCommand |
WRITE_OPERATION_V2 | handleWriteOperationV2 |
EXTENSION | handleCommandPlugin |
SQL_COMMAND | handleSqlCommand |
WRITE_STREAM_OPERATION_START | handleWriteStreamOperationStart |
STREAMING_QUERY_COMMAND | handleStreamingQueryCommand |
STREAMING_QUERY_MANAGER_COMMAND | handleStreamingQueryManagerCommand |
GET_RESOURCES_COMMAND | handleGetResourcesCommand |
process is used when:
ExecuteThreadRunneris requested to handle a command
handleCommandPlugin¶
handleCommandPlugin...FIXME
handleMlCommand¶
handleMlCommand(
command: proto.MlCommand,
responseObserver: StreamObserver[proto.ExecutePlanResponse]): Unit
handleMlCommand handles the ML command (with this SessionHolder).
handleMlCommand requests this ExecuteHolder for the ExecuteEventsManager to postFinished.
In the end, handleMlCommand registers a response with the result of executing the ML command.
handleMlCommand is used when:
SparkConnectPlanneris requested to process aML_COMMANDcommand