@@ -90,6 +90,24 @@ message PipelineCommand {
90
90
optional string format = 8 ;
91
91
}
92
92
93
+ // Metadata about why a query function failed to be executed successfully.
94
+ message QueryFunctionFailure {
95
+ // Identifier for a dataset within the graph that the query function needed to know the schema
96
+ // of but which had not yet been analyzed itself.
97
+ optional string missing_dependency = 1 ;
98
+ }
99
+
100
+ // The result of executing a user-defined query function.
101
+ message QueryFunctionResult {
102
+ oneof flow_function_evaluation_result {
103
+ // If the query function executed successfully, the unresolved logical plan produced by it.
104
+ spark.connect.Relation plan = 1 ;
105
+
106
+ // If the query function failed, metadata about the failure.
107
+ QueryFunctionFailure failure = 2 ;
108
+ }
109
+ }
110
+
93
111
// Request to define a flow targeting a dataset.
94
112
message DefineFlow {
95
113
// The graph to attach this flow to.
@@ -101,14 +119,18 @@ message PipelineCommand {
101
119
// Name of the dataset this flow writes to. Can be partially or fully qualified.
102
120
optional string target_dataset_name = 3 ;
103
121
104
- // An unresolved relation that defines the dataset 's flow.
105
- optional spark.connect.Relation relation = 4 ;
122
+ // The result of executing the flow 's query function
123
+ optional QueryFunctionResult result = 4 ;
106
124
107
125
// SQL configurations set when running this flow.
108
126
map <string , string > sql_conf = 5 ;
109
127
110
128
// If true, this flow will only be run once per full refresh.
111
129
optional bool once = 6 ;
130
+
131
+ // Identifier for the client making the request. The server uses this to determine what flow
132
+ // evaluation request stream to dispatch evaluation requests to for this flow.
133
+ optional string client_id = 7 ;
112
134
}
113
135
114
136
// Resolves all datasets and flows and start a pipeline update. Should be called after all
@@ -129,8 +151,29 @@ message PipelineCommand {
129
151
// The contents of the SQL file.
130
152
optional string sql_text = 3 ;
131
153
}
132
- }
133
154
155
+ // Request to get the stream of query function execution signals for a graph.
156
+ message GetQueryFunctionExecutionSignalStream {
157
+ // The graph to get the query function execution signal stream for.
158
+ optional string dataflow_graph_id = 1 ;
159
+
160
+ // Identifier for the client that is requesting the stream.
161
+ optional string client_id = 2 ;
162
+ }
163
+
164
+ // Request from the client to update the flow function evaluation result
165
+ // for a previously unanalyzed flow.
166
+ message DefineFlowQueryFunctionResult {
167
+ // The fully qualified name of the flow being updated.
168
+ optional string flow_name = 1 ;
169
+
170
+ // The ID of the graph this flow belongs to.
171
+ optional string dataflow_graph_id = 2 ;
172
+
173
+ // The result of executing the flow's query function
174
+ optional QueryFunctionResult result = 3 ;
175
+ }
176
+ }
134
177
135
178
// Dispatch object for pipelines command results.
136
179
message PipelineCommandResult {
@@ -166,3 +209,9 @@ message PipelineEvent {
166
209
// The message that should be displayed to users.
167
210
optional string message = 2 ;
168
211
}
212
+
213
+ // A signal from the server to the client to execute the query function for a flow, and to register
214
+ // its result with the server.
215
+ message PipelineQueryFunctionExecutionSignal {
216
+ optional string flow_name = 1 ;
217
+ }
0 commit comments