Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions meta/src/meta/grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@
%nonterm export_csv_column transactions.ExportCSVColumn
%nonterm export_csv_columns_list Sequence[transactions.ExportCSVColumn]
%nonterm export_csv_config transactions.ExportCSVConfig
%nonterm export_csv_output transactions.ExportCSVOutput
%nonterm export_csv_path String
%nonterm export_csv_source transactions.ExportCSVSource
%nonterm export_iceberg_config transactions.ExportIcebergConfig
%nonterm export_output transactions.ExportOutput
%nonterm export_iceberg_table_def logic.RelationId
%nonterm iceberg_auth_properties Sequence[Tuple[String, String]]
%nonterm iceberg_catalog_config logic.IcebergCatalogConfig
Expand Down Expand Up @@ -1293,6 +1295,10 @@ read
construct: $$ = transactions.Read(export=$1)
deconstruct if builtin.has_proto_field($$, 'export'):
$1: transactions.Export = $$.export
| export_output
construct: $$ = transactions.Read(export_output=$1)
deconstruct if builtin.has_proto_field($$, 'export_output'):
$1: transactions.ExportOutput = $$.export_output

demand
: "(" "demand" relation_id ")"
Expand Down Expand Up @@ -1330,6 +1336,22 @@ export
deconstruct if builtin.has_proto_field($$, 'iceberg_config'):
$3: transactions.ExportIcebergConfig = $$.iceberg_config

# Like `export`, but the engine treats the result as part of the transaction results
# and chooses the output path itself (so no `path` is specified here).
export_output
: "(" "export_output" name export_csv_output ")"
construct: $$ = transactions.ExportOutput(name=$3, csv=$4)
deconstruct if builtin.has_proto_field($$, 'csv'):
$3: String = $$.name
$4: transactions.ExportCSVOutput = $$.csv

export_csv_output
: "(" "csv" export_csv_source csv_config ")"
construct: $$ = transactions.ExportCSVOutput(csv_source=$3, csv_config=$4)
deconstruct:
$3: transactions.ExportCSVSource = $$.csv_source
$4: logic.CSVConfig = $$.csv_config

export_csv_config
: "(" "export_csv_config_v2" export_csv_path export_csv_source csv_config ")"
construct: $$ = construct_export_csv_config_with_source($3, $4, $5)
Expand Down
16 changes: 16 additions & 0 deletions proto/relationalai/lqp/v1/transactions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ message Read {
WhatIf what_if = 3;
Abort abort = 4;
Export export = 5;
ExportOutput export_output = 6;
}
}

Expand Down Expand Up @@ -174,3 +175,18 @@ message Abort {
string name = 1;
RelationId relation_id = 2;
}

message ExportCSVOutput {
ExportCSVSource csv_source = 1;
CSVConfig csv_config = 2;
}

message ExportOutput {
string name = 1;

// Supports export formats e.g., CSV and Iceberg, but considered to be part of txn results
oneof export_output {
ExportCSVOutput csv = 2;
}
}
Comment on lines +179 to +191

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not just reuse ExportCSVConfig instead of introducing ExportCSVOutput?


335 changes: 255 additions & 80 deletions sdks/go/src/lqp/v1/transactions.pb.go

Large diffs are not rendered by default.

5,597 changes: 2,822 additions & 2,775 deletions sdks/go/src/parser.go

Large diffs are not rendered by default.

Loading
Loading