1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ChalkException {
4 #[prost(string, tag = "1")]
6 pub kind: ::prost::alloc::string::String,
7 #[prost(string, tag = "2")]
9 pub message: ::prost::alloc::string::String,
10 #[prost(string, tag = "3")]
12 pub stacktrace: ::prost::alloc::string::String,
13 #[prost(string, tag = "4")]
15 pub internal_stacktrace: ::prost::alloc::string::String,
16}
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct ChalkError {
19 #[prost(enumeration = "ErrorCode", tag = "1")]
20 pub code: i32,
21 #[prost(enumeration = "ErrorCodeCategory", tag = "2")]
22 pub category: i32,
23 #[prost(string, tag = "3")]
25 pub message: ::prost::alloc::string::String,
26 #[prost(string, optional, tag = "101")]
28 pub display_primary_key: ::core::option::Option<::prost::alloc::string::String>,
29 #[prost(string, optional, tag = "102")]
31 pub display_primary_key_fqn: ::core::option::Option<::prost::alloc::string::String>,
32 #[prost(message, optional, tag = "103")]
34 pub exception: ::core::option::Option<ChalkException>,
35 #[prost(string, optional, tag = "104")]
37 pub feature: ::core::option::Option<::prost::alloc::string::String>,
38 #[prost(string, optional, tag = "105")]
40 pub resolver: ::core::option::Option<::prost::alloc::string::String>,
41}
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
43#[repr(i32)]
44pub enum ErrorCode {
45 InternalServerErrorUnspecified = 0,
47 ParseFailed = 1,
49 ResolverNotFound = 2,
53 InvalidQuery = 3,
57 ValidationFailed = 4,
61 ResolverFailed = 5,
63 ResolverTimedOut = 6,
65 UpstreamFailed = 7,
70 Unauthenticated = 8,
72 Unauthorized = 9,
74 Cancelled = 10,
76 DeadlineExceeded = 11,
78}
79impl ErrorCode {
80 pub fn as_str_name(&self) -> &'static str {
85 match self {
86 Self::InternalServerErrorUnspecified => {
87 "ERROR_CODE_INTERNAL_SERVER_ERROR_UNSPECIFIED"
88 }
89 Self::ParseFailed => "ERROR_CODE_PARSE_FAILED",
90 Self::ResolverNotFound => "ERROR_CODE_RESOLVER_NOT_FOUND",
91 Self::InvalidQuery => "ERROR_CODE_INVALID_QUERY",
92 Self::ValidationFailed => "ERROR_CODE_VALIDATION_FAILED",
93 Self::ResolverFailed => "ERROR_CODE_RESOLVER_FAILED",
94 Self::ResolverTimedOut => "ERROR_CODE_RESOLVER_TIMED_OUT",
95 Self::UpstreamFailed => "ERROR_CODE_UPSTREAM_FAILED",
96 Self::Unauthenticated => "ERROR_CODE_UNAUTHENTICATED",
97 Self::Unauthorized => "ERROR_CODE_UNAUTHORIZED",
98 Self::Cancelled => "ERROR_CODE_CANCELLED",
99 Self::DeadlineExceeded => "ERROR_CODE_DEADLINE_EXCEEDED",
100 }
101 }
102 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
104 match value {
105 "ERROR_CODE_INTERNAL_SERVER_ERROR_UNSPECIFIED" => {
106 Some(Self::InternalServerErrorUnspecified)
107 }
108 "ERROR_CODE_PARSE_FAILED" => Some(Self::ParseFailed),
109 "ERROR_CODE_RESOLVER_NOT_FOUND" => Some(Self::ResolverNotFound),
110 "ERROR_CODE_INVALID_QUERY" => Some(Self::InvalidQuery),
111 "ERROR_CODE_VALIDATION_FAILED" => Some(Self::ValidationFailed),
112 "ERROR_CODE_RESOLVER_FAILED" => Some(Self::ResolverFailed),
113 "ERROR_CODE_RESOLVER_TIMED_OUT" => Some(Self::ResolverTimedOut),
114 "ERROR_CODE_UPSTREAM_FAILED" => Some(Self::UpstreamFailed),
115 "ERROR_CODE_UNAUTHENTICATED" => Some(Self::Unauthenticated),
116 "ERROR_CODE_UNAUTHORIZED" => Some(Self::Unauthorized),
117 "ERROR_CODE_CANCELLED" => Some(Self::Cancelled),
118 "ERROR_CODE_DEADLINE_EXCEEDED" => Some(Self::DeadlineExceeded),
119 _ => None,
120 }
121 }
122}
123#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
128#[repr(i32)]
129pub enum ErrorCodeCategory {
130 NetworkUnspecified = 0,
132 Request = 1,
138 Field = 2,
147}
148impl ErrorCodeCategory {
149 pub fn as_str_name(&self) -> &'static str {
154 match self {
155 Self::NetworkUnspecified => "ERROR_CODE_CATEGORY_NETWORK_UNSPECIFIED",
156 Self::Request => "ERROR_CODE_CATEGORY_REQUEST",
157 Self::Field => "ERROR_CODE_CATEGORY_FIELD",
158 }
159 }
160 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
162 match value {
163 "ERROR_CODE_CATEGORY_NETWORK_UNSPECIFIED" => Some(Self::NetworkUnspecified),
164 "ERROR_CODE_CATEGORY_REQUEST" => Some(Self::Request),
165 "ERROR_CODE_CATEGORY_FIELD" => Some(Self::Field),
166 _ => None,
167 }
168 }
169}
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct OnlineQueryRequest {
172 #[prost(map = "string, message", tag = "1")]
173 pub inputs: ::std::collections::HashMap<
174 ::prost::alloc::string::String,
175 ::prost_types::Value,
176 >,
177 #[prost(message, repeated, tag = "2")]
178 pub outputs: ::prost::alloc::vec::Vec<OutputExpr>,
179 #[prost(message, optional, tag = "3")]
180 pub now: ::core::option::Option<::prost_types::Timestamp>,
181 #[prost(map = "string, string", tag = "4")]
182 pub staleness: ::std::collections::HashMap<
183 ::prost::alloc::string::String,
184 ::prost::alloc::string::String,
185 >,
186 #[prost(message, optional, tag = "5")]
187 pub context: ::core::option::Option<OnlineQueryContext>,
188 #[prost(message, optional, tag = "6")]
189 pub response_options: ::core::option::Option<OnlineQueryResponseOptions>,
190}
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct OnlineQueryBulkRequest {
193 #[prost(message, repeated, tag = "2")]
194 pub outputs: ::prost::alloc::vec::Vec<OutputExpr>,
195 #[prost(message, repeated, tag = "3")]
196 pub now: ::prost::alloc::vec::Vec<::prost_types::Timestamp>,
197 #[prost(map = "string, string", tag = "4")]
198 pub staleness: ::std::collections::HashMap<
199 ::prost::alloc::string::String,
200 ::prost::alloc::string::String,
201 >,
202 #[prost(message, optional, tag = "5")]
203 pub context: ::core::option::Option<OnlineQueryContext>,
204 #[prost(message, optional, tag = "6")]
205 pub response_options: ::core::option::Option<OnlineQueryResponseOptions>,
206 #[prost(enumeration = "FeatherBodyType", tag = "7")]
207 pub body_type: i32,
208 #[prost(oneof = "online_query_bulk_request::Inputs", tags = "1, 8")]
209 pub inputs: ::core::option::Option<online_query_bulk_request::Inputs>,
210}
211pub mod online_query_bulk_request {
213 #[derive(Clone, PartialEq, ::prost::Oneof)]
214 pub enum Inputs {
215 #[prost(bytes, tag = "1")]
216 InputsFeather(::prost::alloc::vec::Vec<u8>),
217 #[prost(string, tag = "8")]
218 InputsSql(::prost::alloc::string::String),
219 }
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct GenericSingleQuery {
223 #[prost(oneof = "generic_single_query::Query", tags = "1, 2")]
224 pub query: ::core::option::Option<generic_single_query::Query>,
225}
226pub mod generic_single_query {
228 #[derive(Clone, PartialEq, ::prost::Oneof)]
229 pub enum Query {
230 #[prost(message, tag = "1")]
231 SingleRequest(super::OnlineQueryRequest),
232 #[prost(message, tag = "2")]
233 BulkRequest(super::OnlineQueryBulkRequest),
234 }
235}
236#[derive(Clone, PartialEq, ::prost::Message)]
237pub struct OnlineQueryMultiRequest {
238 #[prost(message, repeated, tag = "1")]
239 pub queries: ::prost::alloc::vec::Vec<GenericSingleQuery>,
240}
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct FeatureExpression {
243 #[prost(string, tag = "1")]
244 pub output_column_name: ::prost::alloc::string::String,
245 #[prost(string, tag = "3")]
246 pub namespace: ::prost::alloc::string::String,
247 #[prost(message, optional, tag = "2")]
248 pub expr: ::core::option::Option<super::super::expression::v1::LogicalExprNode>,
249}
250#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct OutputExpr {
254 #[prost(oneof = "output_expr::Expr", tags = "1, 2")]
255 pub expr: ::core::option::Option<output_expr::Expr>,
256}
257pub mod output_expr {
259 #[derive(Clone, PartialEq, ::prost::Oneof)]
260 pub enum Expr {
261 #[prost(string, tag = "1")]
262 FeatureFqn(::prost::alloc::string::String),
263 #[prost(message, tag = "2")]
264 FeatureExpression(super::FeatureExpression),
265 }
266}
267#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct OnlineQueryContext {
270 #[deprecated]
272 #[prost(string, tag = "1")]
273 pub environment: ::prost::alloc::string::String,
274 #[prost(string, repeated, tag = "2")]
275 pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
276 #[prost(string, repeated, tag = "3")]
277 pub required_resolver_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
278 #[deprecated]
280 #[prost(string, optional, tag = "4")]
281 pub deployment_id: ::core::option::Option<::prost::alloc::string::String>,
282 #[deprecated]
284 #[prost(string, optional, tag = "5")]
285 pub branch_id: ::core::option::Option<::prost::alloc::string::String>,
286 #[prost(string, optional, tag = "6")]
287 pub correlation_id: ::core::option::Option<::prost::alloc::string::String>,
288 #[prost(string, optional, tag = "7")]
289 pub query_name: ::core::option::Option<::prost::alloc::string::String>,
290 #[prost(string, optional, tag = "8")]
291 pub query_name_version: ::core::option::Option<::prost::alloc::string::String>,
292 #[prost(map = "string, message", tag = "9")]
295 pub options: ::std::collections::HashMap<
296 ::prost::alloc::string::String,
297 ::prost_types::Value,
298 >,
299 #[prost(message, repeated, tag = "10")]
301 pub value_metrics_tag_by_features: ::prost::alloc::vec::Vec<OutputExpr>,
302 #[prost(map = "string, message", tag = "11")]
304 pub query_context: ::std::collections::HashMap<
305 ::prost::alloc::string::String,
306 ::prost_types::Value,
307 >,
308 #[prost(message, optional, tag = "12")]
310 pub overlay_graph: ::core::option::Option<super::super::graph::v1::OverlayGraph>,
311}
312#[derive(Clone, PartialEq, ::prost::Message)]
314pub struct OnlineQueryResponseOptions {
315 #[prost(bool, tag = "1")]
316 pub include_meta: bool,
317 #[prost(message, optional, tag = "2")]
318 pub explain: ::core::option::Option<ExplainOptions>,
319 #[prost(message, optional, tag = "3")]
320 pub encoding_options: ::core::option::Option<FeatureEncodingOptions>,
321 #[prost(map = "string, string", tag = "4")]
323 pub metadata: ::std::collections::HashMap<
324 ::prost::alloc::string::String,
325 ::prost::alloc::string::String,
326 >,
327}
328#[derive(Clone, Copy, PartialEq, ::prost::Message)]
329pub struct ExplainOptions {}
330#[derive(Clone, Copy, PartialEq, ::prost::Message)]
331pub struct FeatureEncodingOptions {
332 #[prost(bool, tag = "1")]
333 pub encode_structs_as_objects: bool,
334}
335#[derive(Clone, PartialEq, ::prost::Message)]
336pub struct OnlineQueryResponse {
337 #[prost(message, optional, tag = "1")]
338 pub data: ::core::option::Option<OnlineQueryResult>,
339 #[prost(message, repeated, tag = "2")]
340 pub errors: ::prost::alloc::vec::Vec<ChalkError>,
341 #[prost(message, optional, tag = "3")]
342 pub response_meta: ::core::option::Option<OnlineQueryMetadata>,
343}
344#[derive(Clone, PartialEq, ::prost::Message)]
345pub struct OnlineQueryBulkResponse {
346 #[prost(bytes = "vec", tag = "1")]
347 pub scalars_data: ::prost::alloc::vec::Vec<u8>,
348 #[prost(map = "string, bytes", tag = "2")]
349 pub groups_data: ::std::collections::HashMap<
350 ::prost::alloc::string::String,
351 ::prost::alloc::vec::Vec<u8>,
352 >,
353 #[prost(message, repeated, tag = "3")]
354 pub errors: ::prost::alloc::vec::Vec<ChalkError>,
355 #[prost(message, optional, tag = "4")]
356 pub response_meta: ::core::option::Option<OnlineQueryMetadata>,
357}
358#[derive(Clone, PartialEq, ::prost::Message)]
359pub struct GenericSingleResponse {
360 #[prost(oneof = "generic_single_response::Query", tags = "1, 2")]
361 pub query: ::core::option::Option<generic_single_response::Query>,
362}
363pub mod generic_single_response {
365 #[derive(Clone, PartialEq, ::prost::Oneof)]
366 pub enum Query {
367 #[prost(message, tag = "1")]
368 SingleResponse(super::OnlineQueryResponse),
369 #[prost(message, tag = "2")]
370 BulkResponse(super::OnlineQueryBulkResponse),
371 }
372}
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct OnlineQueryMultiResponse {
375 #[prost(message, repeated, tag = "1")]
376 pub responses: ::prost::alloc::vec::Vec<GenericSingleResponse>,
377 #[prost(message, repeated, tag = "2")]
379 pub errors: ::prost::alloc::vec::Vec<ChalkError>,
380}
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct OnlineQueryResult {
383 #[prost(message, repeated, tag = "1")]
384 pub results: ::prost::alloc::vec::Vec<FeatureResult>,
385}
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct FeatureResult {
388 #[prost(string, tag = "1")]
389 pub field: ::prost::alloc::string::String,
390 #[prost(message, optional, tag = "6")]
391 pub pkey: ::core::option::Option<::prost_types::Value>,
392 #[prost(message, optional, tag = "2")]
393 pub value: ::core::option::Option<::prost_types::Value>,
394 #[prost(message, optional, tag = "3")]
395 pub error: ::core::option::Option<ChalkError>,
396 #[prost(message, optional, tag = "4")]
397 pub ts: ::core::option::Option<::prost_types::Timestamp>,
398 #[prost(message, optional, tag = "5")]
399 pub meta: ::core::option::Option<FeatureMeta>,
400}
401#[derive(Clone, PartialEq, ::prost::Message)]
402pub struct FeatureMeta {
403 #[prost(string, tag = "1")]
404 pub chosen_resolver_fqn: ::prost::alloc::string::String,
405 #[prost(bool, tag = "2")]
406 pub cache_hit: bool,
407 #[prost(string, tag = "3")]
408 pub primitive_type: ::prost::alloc::string::String,
409 #[prost(int64, tag = "4")]
410 pub version: i64,
411}
412#[derive(Clone, PartialEq, ::prost::Message)]
413pub struct OnlineQueryMetadata {
414 #[prost(message, optional, tag = "1")]
415 pub execution_duration: ::core::option::Option<::prost_types::Duration>,
416 #[prost(string, tag = "2")]
417 pub deployment_id: ::prost::alloc::string::String,
418 #[prost(string, tag = "3")]
419 pub environment_id: ::prost::alloc::string::String,
420 #[prost(string, tag = "4")]
421 pub environment_name: ::prost::alloc::string::String,
422 #[prost(string, tag = "5")]
423 pub query_id: ::prost::alloc::string::String,
424 #[prost(message, optional, tag = "6")]
425 pub query_timestamp: ::core::option::Option<::prost_types::Timestamp>,
426 #[prost(string, tag = "7")]
427 pub query_hash: ::prost::alloc::string::String,
428 #[prost(message, optional, tag = "8")]
429 pub explain_output: ::core::option::Option<QueryExplainInfo>,
430 #[prost(map = "string, string", tag = "9")]
432 pub metadata: ::std::collections::HashMap<
433 ::prost::alloc::string::String,
434 ::prost::alloc::string::String,
435 >,
436 #[prost(map = "string, message", tag = "10")]
437 pub additional_metadata: ::std::collections::HashMap<
438 ::prost::alloc::string::String,
439 ::prost_types::Value,
440 >,
441}
442#[derive(Clone, PartialEq, ::prost::Message)]
443pub struct QueryExplainInfo {
444 #[prost(string, optional, tag = "1")]
446 pub plan_string: ::core::option::Option<::prost::alloc::string::String>,
447}
448#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct UploadFeaturesBulkRequest {
451 #[prost(bytes = "vec", tag = "1")]
452 pub inputs_feather: ::prost::alloc::vec::Vec<u8>,
453 #[prost(enumeration = "FeatherBodyType", tag = "7")]
454 pub body_type: i32,
455}
456#[derive(Clone, PartialEq, ::prost::Message)]
457pub struct UploadFeaturesBulkResponse {
458 #[prost(message, repeated, tag = "1")]
459 pub errors: ::prost::alloc::vec::Vec<ChalkError>,
460}
461#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
462#[repr(i32)]
463pub enum FeatherBodyType {
464 Unspecified = 0,
465 Table = 1,
466 RecordBatches = 2,
467}
468impl FeatherBodyType {
469 pub fn as_str_name(&self) -> &'static str {
474 match self {
475 Self::Unspecified => "FEATHER_BODY_TYPE_UNSPECIFIED",
476 Self::Table => "FEATHER_BODY_TYPE_TABLE",
477 Self::RecordBatches => "FEATHER_BODY_TYPE_RECORD_BATCHES",
478 }
479 }
480 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
482 match value {
483 "FEATHER_BODY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
484 "FEATHER_BODY_TYPE_TABLE" => Some(Self::Table),
485 "FEATHER_BODY_TYPE_RECORD_BATCHES" => Some(Self::RecordBatches),
486 _ => None,
487 }
488 }
489}
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct UploadFeaturesRequest {
492 #[prost(bytes = "vec", tag = "1")]
493 pub inputs_table: ::prost::alloc::vec::Vec<u8>,
494}
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct UploadFeaturesResponse {
497 #[prost(message, repeated, tag = "1")]
498 pub errors: ::prost::alloc::vec::Vec<ChalkError>,
499 #[prost(string, tag = "2")]
500 pub operation_id: ::prost::alloc::string::String,
501}