SparkConnectPlanner¶
Creating Instance¶
SparkConnectPlanner
takes the following to be created:
SparkConnectPlanner
is created when:
ExecuteThreadRunner
is requested to handle a commandSparkConnectPlanExecution
is requested to handle a planSparkConnectAnalyzeHandler
is requested to process an analyze plan request
transformRelation¶
transformRelation
...FIXME
transformRelation
is used when:
SparkConnectPlanExecution
is requested to handlePlanSparkConnectPlanner
is requested to do many thingsSparkConnectAnalyzeHandler
is 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:
SparkConnectPlanner
is requested to transformMapPartitions, transformGroupMap, transformCoGroupMap, transformCommonInlineUserDefinedFunction
transformPythonFunction¶
transformPythonFunction
...FIXME
transformPythonFunction
is used when:
SparkConnectPlanner
is 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:
ExecuteThreadRunner
is 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:
SparkConnectPlanner
is requested to process aML_COMMAND
command