-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added proto definitions for Data Preparations (#1788)
* Added proto definitions for Data Preparations * Moved Data preparation protos into a separate file
- Loading branch information
Showing
4 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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,174 @@ | ||
syntax = "proto3"; | ||
|
||
package dataform; | ||
|
||
option java_package = "com.dataform.protos"; | ||
option java_multiple_files = true; | ||
|
||
option go_package = "github.com/dataform-co/dataform/protos/dataform"; | ||
|
||
message DataPreparationDefinition { | ||
repeated DataPreparationNode nodes = 1; | ||
DataPreparationGenerated generated = 2; | ||
} | ||
|
||
message DataPreparationNode { | ||
string id = 1; | ||
DataPreparationNodeSource source = 2; | ||
repeated DataPreparationNodeStep steps = 3; | ||
DataPreparationNodeGenerated generated = 4; | ||
// Destination BigQuery table(s) are defined within the data preparation | ||
optional DataPreparationNodeDestination destination = 5; | ||
} | ||
|
||
message DataPreparationNodeSource { | ||
oneof source { | ||
string node_id = 1; | ||
TableReference table = 2; | ||
Join join = 3; | ||
} | ||
} | ||
|
||
message DataPreparationNodeDestination { | ||
oneof destination { | ||
TableReference table = 1; | ||
} | ||
} | ||
|
||
message DataPreparationNodeStep { | ||
string id = 1; | ||
string description = 2; | ||
oneof definition { | ||
ColumnStep column_step = 3; | ||
FilterStep filter_step = 4; | ||
} | ||
DataPreparationNodeStepGenerated generated = 5; | ||
} | ||
|
||
message ColumnStep { | ||
string column_name = 1; | ||
Expression expression = 2; | ||
} | ||
|
||
message FilterStep { | ||
Expression expression = 1; | ||
} | ||
|
||
message Expression { | ||
oneof expression { | ||
string sql = 1; | ||
} | ||
} | ||
|
||
message Join { | ||
string left_node_id = 1; | ||
string right_node_id = 2; | ||
JoinType join_type = 3; | ||
JoinCondition join_condition = 4; | ||
} | ||
|
||
enum JoinType { | ||
JOIN_TYPE_UNSPECIFIED = 0; | ||
JOIN_TYPE_INNER = 1; | ||
JOIN_TYPE_FULL_OUTER = 2; | ||
JOIN_TYPE_LEFT = 3; | ||
JOIN_TYPE_RIGHT = 4; | ||
} | ||
|
||
message JoinCondition { | ||
oneof condition { | ||
Expression expression = 1; | ||
JoinKeys keys = 2; | ||
} | ||
} | ||
|
||
message JoinKeys { | ||
repeated JoinKey keys = 1; | ||
} | ||
|
||
message JoinKey { | ||
string left_column = 1; | ||
string right_column = 2; | ||
} | ||
|
||
message TableReference { | ||
string project = 1; | ||
string dataset = 2; | ||
string table = 3; | ||
} | ||
|
||
message DataPreparationGenerated { | ||
repeated DataPreparationValidationError validation_errors = 1; | ||
optional string location = 2; | ||
} | ||
|
||
message DataPreparationNodeGenerated { | ||
repeated DataPreparationSection sections = 1; | ||
repeated string sources = 2; | ||
repeated DataPreparationValidationError validation_errors = 3; | ||
optional DataPreparationSchema output_schema = 4; | ||
DataPreparationNodeSourceGenerated source_generated = 5; | ||
optional DataPreparationNodeDestinationGenerated destination_generated = 6; | ||
} | ||
|
||
message DataPreparationSection { | ||
DataPreparationSectionType type = 1; | ||
string label = 2; | ||
} | ||
|
||
enum DataPreparationSectionType { | ||
SECTION_TYPE_UNSPECIFIED = 0; | ||
SECTION_UNPARSEABLE = 1; | ||
SECTION_SOURCE_TABLE = 2; | ||
SECTION_SQL = 3; | ||
SECTION_DESTINATION_TABLE = 4; | ||
} | ||
|
||
message DataPreparationNodeSourceGenerated { | ||
optional DataPreparationNodeSourceSourceSchema source_schema = 4; | ||
} | ||
|
||
message DataPreparationNodeSourceSourceSchema { | ||
oneof source_schema { | ||
DataPreparationSchema node_schema = 1; | ||
DataPreparationSchema table_schema = 2; | ||
JoinSchema join_schema = 3; | ||
} | ||
} | ||
|
||
message JoinSchema { | ||
DataPreparationSchema left_schema = 1; | ||
DataPreparationSchema right_schema = 2; | ||
} | ||
|
||
message DataPreparationNodeDestinationGenerated { | ||
optional DataPreparationSchema schema = 1; | ||
} | ||
|
||
message DataPreparationNodeStepGenerated { | ||
repeated string source_columns = 1; | ||
repeated DataPreparationValidationError validation_errors = 2; | ||
} | ||
|
||
message DataPreparationSchema { | ||
repeated DataPreparationSchemaField field = 1; | ||
} | ||
|
||
message DataPreparationSchemaField { | ||
string name = 1; | ||
optional string type = 2; | ||
optional string mode = 3; | ||
repeated DataPreparationSchemaField fields = 4; | ||
} | ||
|
||
message DataPreparationValidationError { | ||
DataPreparationValidationErrorLevel level = 1; | ||
string description = 2; | ||
} | ||
|
||
enum DataPreparationValidationErrorLevel { | ||
LEVEL_UNSPECIFIED = 0; | ||
LEVEL_WARN = 1; | ||
LEVEL_ERROR = 2; | ||
LEVEL_FATAL = 3; | ||
} |