@@ -36,6 +36,8 @@ message PipelineCommand {
3636 DropDataflowGraph drop_dataflow_graph = 4 ;
3737 StartRun start_run = 5 ;
3838 DefineSqlGraphElements define_sql_graph_elements = 6 ;
39+ GetQueryFunctionExecutionSignalStream get_query_function_execution_signal_stream = 7 ;
40+ DefineFlowQueryFunctionResult define_flow_query_function_result = 8 ;
3941 }
4042
4143 // Request to create a new dataflow graph.
@@ -90,6 +92,24 @@ message PipelineCommand {
9092 optional string format = 8 ;
9193 }
9294
95+ // Metadata about why a query function failed to be executed successfully.
96+ message QueryFunctionFailure {
97+ // Identifier for a dataset within the graph that the query function needed to know the schema
98+ // of but which had not yet been analyzed itself.
99+ optional string missing_dependency = 1 ;
100+ }
101+
102+ // The result of executing a user-defined query function.
103+ message QueryFunctionResult {
104+ oneof flow_function_evaluation_result {
105+ // If the query function executed successfully, the unresolved logical plan produced by it.
106+ spark.connect.Relation plan = 1 ;
107+
108+ // If the query function failed, metadata about the failure.
109+ QueryFunctionFailure failure = 2 ;
110+ }
111+ }
112+
93113 // Request to define a flow targeting a dataset.
94114 message DefineFlow {
95115 // The graph to attach this flow to.
@@ -101,11 +121,23 @@ message PipelineCommand {
101121 // Name of the dataset this flow writes to. Can be partially or fully qualified.
102122 optional string target_dataset_name = 3 ;
103123
104- // An unresolved relation that defines the dataset's flow.
105- optional spark.connect.Relation relation = 4 ;
124+ // [Deprecated] An unresolved relation that defines the dataset's flow.
125+ optional spark.connect.Relation relation = 4 [deprecated = true ];
126+
127+ // The result of executing the flow's query function
128+ optional QueryFunctionResult result = 7 ;
106129
107130 // SQL configurations set when running this flow.
108131 map <string , string > sql_conf = 5 ;
132+
133+ // Identifier for the client making the request. The server uses this to determine what flow
134+ // evaluation request stream to dispatch evaluation requests to for this flow.
135+ optional string client_id = 6 ;
136+
137+ message Response {
138+ // Fully qualified flow name that uniquely identify a flow in the Dataflow graph.
139+ optional string flow_name = 1 ;
140+ }
109141 }
110142
111143 // Resolves all datasets and flows and start a pipeline update. Should be called after all
@@ -116,10 +148,10 @@ message PipelineCommand {
116148
117149 // List of dataset to reset and recompute.
118150 repeated string full_refresh_selection = 2 ;
119-
151+
120152 // Perform a full graph reset and recompute.
121153 optional bool full_refresh_all = 3 ;
122-
154+
123155 // List of dataset to update.
124156 repeated string refresh_selection = 4 ;
125157
@@ -139,8 +171,30 @@ message PipelineCommand {
139171 // The contents of the SQL file.
140172 optional string sql_text = 3 ;
141173 }
142- }
143174
175+ // Request to get the stream of query function execution signals for a graph. Responses should
176+ // be a stream of PipelineQueryFunctionExecutionSignal messages.
177+ message GetQueryFunctionExecutionSignalStream {
178+ // The graph to get the query function execution signal stream for.
179+ optional string dataflow_graph_id = 1 ;
180+
181+ // Identifier for the client that is requesting the stream.
182+ optional string client_id = 2 ;
183+ }
184+
185+ // Request from the client to update the flow function evaluation result
186+ // for a previously unanalyzed flow.
187+ message DefineFlowQueryFunctionResult {
188+ // The fully qualified name of the flow being updated.
189+ optional string flow_name = 1 ;
190+
191+ // The ID of the graph this flow belongs to.
192+ optional string dataflow_graph_id = 2 ;
193+
194+ // The result of executing the flow's query function
195+ optional QueryFunctionResult result = 3 ;
196+ }
197+ }
144198
145199// Dispatch object for pipelines command results.
146200message PipelineCommandResult {
@@ -176,3 +230,9 @@ message PipelineEvent {
176230 // The message that should be displayed to users.
177231 optional string message = 2 ;
178232}
233+
234+ // A signal from the server to the client to execute the query function for one or more flows, and
235+ // to register their results with the server.
236+ message PipelineQueryFunctionExecutionSignal {
237+ repeated string flow_names = 1 ;
238+ }
0 commit comments