Skip to content

Commit 65d373a

Browse files
committed
the rest
1 parent cfc532a commit 65d373a

22 files changed

Lines changed: 13942 additions & 13755 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@
117117
%nonterm export_csv_path String
118118
%nonterm export_csv_source transactions.ExportCSVSource
119119
%nonterm export_iceberg_config transactions.ExportIcebergConfig
120-
%nonterm iceberg_config logic.IcebergConfig
120+
%nonterm iceberg_config logic.IcebergCatalogConfig
121121
%nonterm iceberg_config_scope String
122122
%nonterm iceberg_data logic.IcebergData
123-
%nonterm iceberg_export_column transactions.IcebergExportColumn
123+
%nonterm iceberg_export_column transactions.ExportIcebergColumn
124124
%nonterm iceberg_locator logic.IcebergLocator
125125
%nonterm iceberg_property_entry Tuple[String, String]
126126
%nonterm iceberg_to_snapshot String
@@ -1168,12 +1168,13 @@ iceberg_config
11681168
$14: Sequence[Tuple[String, String]] = builtin.dict_to_pairs($$.auth_properties)
11691169

11701170
iceberg_export_column
1171-
: "(" "iceberg_column" STRING type boolean_value ")"
1172-
construct: $$ = transactions.IcebergExportColumn(name=$3, type=$4, nullable=$5)
1171+
: "(" "iceberg_column" STRING relation_id type boolean_value ")"
1172+
construct: $$ = transactions.ExportIcebergColumn(name=$3, column_data=$4, type=$5, nullable=$6)
11731173
deconstruct:
11741174
$3: String = $$.name
1175-
$4: logic.Type = $$.type
1176-
$5: Boolean = $$.nullable
1175+
$4: logic.RelationId = $$.column_data
1176+
$5: logic.Type = $$.type
1177+
$6: Boolean = $$.nullable
11771178

11781179
iceberg_to_snapshot
11791180
: "(" "to_snapshot" STRING ")"
@@ -1185,7 +1186,7 @@ iceberg_data
11851186
construct: $$ = logic.IcebergData(locator=$3, config=$4, columns=$5, to_snapshot=builtin.some(builtin.unwrap_option_or($6, "")))
11861187
deconstruct:
11871188
$3: logic.IcebergLocator = $$.locator
1188-
$4: logic.IcebergConfig = $$.config
1189+
$4: logic.IcebergCatalogConfig = $$.config
11891190
$5: Sequence[logic.GNFColumn] = $$.columns
11901191
$6: Optional[String] = deconstruct_iceberg_data_to_snapshot_optional($$)
11911192

@@ -1310,13 +1311,14 @@ export_csv_source
13101311
$3: logic.RelationId = $$.table_def
13111312

13121313
export_iceberg_config
1313-
: "(" "export_iceberg_config" iceberg_locator iceberg_config "(" "columns" iceberg_export_column* ")" config_dict? ")"
1314-
construct: $$ = construct_export_iceberg_config_full($3, $4, $7, $9)
1314+
: "(" "export_iceberg_config" iceberg_locator iceberg_config "(" "columns" iceberg_export_column* ")" "(" "create_table_properties" iceberg_property_entry* ")" config_dict? ")"
1315+
construct: $$ = construct_export_iceberg_config_full($3, $4, $7, $11, $13)
13151316
deconstruct:
13161317
$3: logic.IcebergLocator = $$.locator
1317-
$4: logic.IcebergConfig = $$.config
1318-
$7: Sequence[transactions.IcebergExportColumn] = $$.columns
1319-
$9: Optional[Sequence[Tuple[String, logic.Value]]] = deconstruct_export_iceberg_config_optional($$)
1318+
$4: logic.IcebergCatalogConfig = $$.config
1319+
$7: Sequence[transactions.ExportIcebergColumn] = $$.columns
1320+
$11: Sequence[Tuple[String, String]] = builtin.dict_to_pairs($$.create_table_properties)
1321+
$13: Optional[Sequence[Tuple[String, logic.Value]]] = deconstruct_export_iceberg_config_optional($$)
13201322

13211323

13221324
%%
@@ -1640,18 +1642,18 @@ def construct_iceberg_config(
16401642
scope_opt: Optional[String],
16411643
property_pairs: Sequence[Tuple[String, String]],
16421644
auth_property_pairs: Sequence[Tuple[String, String]],
1643-
) -> logic.IcebergConfig:
1645+
) -> logic.IcebergCatalogConfig:
16441646
props: Dict[String, String] = builtin.string_map_from_pairs(property_pairs)
16451647
auth_props: Dict[String, String] = builtin.string_map_from_pairs(auth_property_pairs)
1646-
return logic.IcebergConfig(
1648+
return logic.IcebergCatalogConfig(
16471649
catalog_uri=catalog_uri,
16481650
scope=builtin.some(builtin.unwrap_option_or(scope_opt, "")),
16491651
properties=props,
16501652
auth_properties=auth_props,
16511653
)
16521654

16531655

1654-
def deconstruct_iceberg_config_scope_optional(msg: logic.IcebergConfig) -> Optional[String]:
1656+
def deconstruct_iceberg_config_scope_optional(msg: logic.IcebergCatalogConfig) -> Optional[String]:
16551657
if builtin.unwrap_option(msg.scope) != "":
16561658
return builtin.some(builtin.unwrap_option(msg.scope))
16571659
return builtin.none()
@@ -1665,21 +1667,24 @@ def deconstruct_iceberg_data_to_snapshot_optional(msg: logic.IcebergData) -> Opt
16651667

16661668
def construct_export_iceberg_config_full(
16671669
locator: logic.IcebergLocator,
1668-
config: logic.IcebergConfig,
1669-
columns: Sequence[transactions.IcebergExportColumn],
1670+
config: logic.IcebergCatalogConfig,
1671+
columns: Sequence[transactions.ExportIcebergColumn],
1672+
create_table_property_pairs: Sequence[Tuple[String, String]],
16701673
config_dict: Optional[Sequence[Tuple[String, logic.Value]]],
16711674
) -> transactions.ExportIcebergConfig:
16721675
cfg: Dict[String, logic.Value] = builtin.dict_from_list(builtin.unwrap_option_or(config_dict, list[Tuple[String, logic.Value]]()))
16731676
prefix: String = _extract_value_string(builtin.dict_get(cfg, "prefix"), "")
16741677
target_file_size_bytes: int = _extract_value_int64(builtin.dict_get(cfg, "target_file_size_bytes"), 0)
16751678
compression: String = _extract_value_string(builtin.dict_get(cfg, "compression"), "")
1679+
create_table_props: Dict[String, String] = builtin.string_map_from_pairs(create_table_property_pairs)
16761680
return transactions.ExportIcebergConfig(
16771681
locator=locator,
16781682
config=config,
16791683
columns=columns,
16801684
prefix=builtin.some(prefix),
16811685
target_file_size_bytes=builtin.some(target_file_size_bytes),
16821686
compression=compression,
1687+
create_table_properties=create_table_props,
16831688
)
16841689

16851690

0 commit comments

Comments
 (0)