Skip to content

Commit 86f8dfe

Browse files
davidwzhaoclaude
andcommitted
Extend grammar for ExportOutput action
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c2295de commit 86f8dfe

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@
115115
%nonterm export_csv_column transactions.ExportCSVColumn
116116
%nonterm export_csv_columns_list Sequence[transactions.ExportCSVColumn]
117117
%nonterm export_csv_config transactions.ExportCSVConfig
118+
%nonterm export_csv_output transactions.ExportCSVOutput
118119
%nonterm export_csv_path String
119120
%nonterm export_csv_source transactions.ExportCSVSource
120121
%nonterm export_iceberg_config transactions.ExportIcebergConfig
122+
%nonterm export_output transactions.ExportOutput
121123
%nonterm export_iceberg_table_def logic.RelationId
122124
%nonterm iceberg_auth_properties Sequence[Tuple[String, String]]
123125
%nonterm iceberg_catalog_config logic.IcebergCatalogConfig
@@ -1293,6 +1295,10 @@ read
12931295
construct: $$ = transactions.Read(export=$1)
12941296
deconstruct if builtin.has_proto_field($$, 'export'):
12951297
$1: transactions.Export = $$.export
1298+
| export_output
1299+
construct: $$ = transactions.Read(export_output=$1)
1300+
deconstruct if builtin.has_proto_field($$, 'export_output'):
1301+
$1: transactions.ExportOutput = $$.export_output
12961302

12971303
demand
12981304
: "(" "demand" relation_id ")"
@@ -1330,6 +1336,21 @@ export
13301336
deconstruct if builtin.has_proto_field($$, 'iceberg_config'):
13311337
$3: transactions.ExportIcebergConfig = $$.iceberg_config
13321338

1339+
# Like `export`, but the engine treats the result as part of the transaction results
1340+
# and chooses the output path itself (so no `path` is specified here).
1341+
export_output
1342+
: "(" "output_export" export_csv_output ")"
1343+
construct: $$ = transactions.ExportOutput(csv=$3)
1344+
deconstruct if builtin.has_proto_field($$, 'csv'):
1345+
$3: transactions.ExportCSVOutput = $$.csv
1346+
1347+
export_csv_output
1348+
: "(" "csv" export_csv_source csv_config ")"
1349+
construct: $$ = transactions.ExportCSVOutput(csv_source=$3, csv_config=$4)
1350+
deconstruct:
1351+
$3: transactions.ExportCSVSource = $$.csv_source
1352+
$4: logic.CSVConfig = $$.csv_config
1353+
13331354
export_csv_config
13341355
: "(" "export_csv_config_v2" export_csv_path export_csv_source csv_config ")"
13351356
construct: $$ = construct_export_csv_config_with_source($3, $4, $5)

0 commit comments

Comments
 (0)