-
Notifications
You must be signed in to change notification settings - Fork 193
JiT context RPC service and protos #2079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+215
−86
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package dataform; | ||
|
|
||
| import "protos/core.proto"; | ||
|
|
||
| // Common structures for Evaluation, execution and compilation. | ||
|
|
||
| message Field { | ||
| enum Primitive { | ||
| UNKNOWN = 0; | ||
| INTEGER = 1; | ||
| FLOAT = 2; | ||
| NUMERIC = 5; | ||
| BOOLEAN = 3; | ||
| STRING = 4; | ||
| DATE = 6; | ||
| DATETIME = 7; | ||
| TIMESTAMP = 8; | ||
| TIME = 9; | ||
| BYTES = 10; | ||
| ANY = 11; | ||
| GEOGRAPHY = 12; | ||
| } | ||
|
|
||
| enum Flag { | ||
| UNKNOWN_FLAG = 0; | ||
| REPEATED = 1; | ||
| } | ||
|
|
||
| string name = 1; | ||
|
|
||
| repeated Flag flags = 6; | ||
|
|
||
| oneof type { | ||
| Primitive primitive = 7; | ||
| Fields struct = 3; | ||
| } | ||
|
|
||
| string description = 5; | ||
|
|
||
| reserved 2, 4; | ||
| } | ||
|
|
||
| message Fields { | ||
| repeated Field fields = 1; | ||
| } | ||
|
|
||
| message TableMetadata { | ||
| Target target = 1; | ||
| enum Type { | ||
| UNKNOWN = 0; | ||
| TABLE = 1; | ||
| VIEW = 2; | ||
| } | ||
| Type type = 6; | ||
|
|
||
| repeated Field fields = 3; | ||
| string description = 5; | ||
| map<string, string> labels = 7; | ||
| int64 last_updated_millis = 4; | ||
|
|
||
| message BigQuery { | ||
| bool has_streaming_buffer = 1; | ||
| } | ||
| BigQuery bigquery = 8; | ||
|
|
||
| reserved 2; | ||
| } | ||
|
|
||
| message ExecutionMetadata { | ||
| message BigqueryMetadata { | ||
| string job_id = 1; | ||
| int64 total_bytes_processed = 2; | ||
| int64 total_bytes_billed = 3; | ||
| } | ||
| BigqueryMetadata bigquery = 1; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package dataform; | ||
|
|
||
| import "google/protobuf/empty.proto"; | ||
| import "google/protobuf/struct.proto"; | ||
| import "protos/core.proto"; | ||
| import "protos/db_adapter.proto"; | ||
|
|
||
| // Database adapter, available in JiT compilation context. | ||
| service DbAdapter { | ||
| // Executes a query. | ||
| rpc Execute(ExecuteRequest) returns (ExecuteResponse) {} | ||
|
|
||
| // Lists table in schema. | ||
| rpc ListTables(ListTablesRequest) returns (ListTablesResponse) {} | ||
|
|
||
| // Gets table for target. | ||
| rpc GetTable(GetTableRequest) returns (TableMetadata) {} | ||
|
|
||
| // Drops table of specified target. | ||
| rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) {} | ||
| } | ||
|
|
||
| // Request to execute synchronous SQL query. | ||
| message ExecuteRequest { | ||
| // SQL statement query. | ||
| string statement = 1; | ||
| // Max rows to return in the job. | ||
| int64 row_limit = 2; | ||
| // Max bytes to process. | ||
| int64 byte_limit = 3; | ||
| // Whether or not fetch result rows. | ||
| bool fetch_results = 4; | ||
|
|
||
| BigQueryExecuteOptions big_query_options = 5; | ||
| } | ||
|
|
||
| message BigQueryExecuteOptions { | ||
| // Priority - interactive if true or batch if false (default). | ||
| bool interactive = 1; | ||
| // See https://docs.cloud.google.com/bigquery/docs/reference/legacy-sql. | ||
| bool use_legacy_sql = 2; | ||
ikholopov-omni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Labels to add to the job. | ||
| map<string, string> labels = 3; | ||
| // Location to execute the job at. | ||
| string location = 4; | ||
| // Job prefix to add. | ||
| string job_prefix = 5; | ||
| // Is dry run job. | ||
| bool dry_run = 6; | ||
| } | ||
|
|
||
| // Synchronous execution response result. | ||
| message ExecuteResponse { | ||
| // Job metadata. | ||
| ExecutionMetadata execution_metadata = 1; | ||
| // Rows. For BigQuery, see | ||
| // https://docs.cloud.google.com/bigquery/docs/reference/rest/v2/jobs/getQueryResults. | ||
| repeated google.protobuf.Struct rows = 2; | ||
| repeated string errors = 3; | ||
| } | ||
|
|
||
| // Request to list tables in schema. | ||
| message ListTablesRequest { | ||
| string database = 1; | ||
| string schema = 2; | ||
| } | ||
|
|
||
| // Tables metadata in schema. | ||
| message ListTablesResponse { | ||
| repeated TableMetadata tables = 1; | ||
| } | ||
|
|
||
| // Request to get table metadata for target. | ||
| message GetTableRequest { | ||
| Target target = 1; | ||
| } | ||
|
|
||
| // Request to drop the table for target. | ||
| message DeleteTableRequest { | ||
| Target target = 1; | ||
| } | ||
|
|
||
| // JiT compilation result for table actions (including views). | ||
| // Fields match the Table message. | ||
| message JitTableResult { | ||
| // SQL Select query of the table. | ||
| string query = 1; | ||
| // Optional pre-operation statements. | ||
| repeated string pre_ops = 3; | ||
| // Optional post-operation statements. | ||
| repeated string post_ops = 4; | ||
| } | ||
|
|
||
| // JiT compilation result for incremental table actions. | ||
| message JitIncrementalTableResult { | ||
| // Fields match the Table message. | ||
| JitTableResult regular = 1; | ||
| // Fields match incremental_ fields in the Table message. | ||
| JitTableResult incremental = 2; | ||
| } | ||
|
|
||
| // JiT compilation result for operation actions. | ||
| message JitOperationResult { | ||
| // Sequence of SQL operations. | ||
| repeated string queries = 1; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.