Skip to content

Commit ce29c19

Browse files
committed
update snapshots, fix julia errors (hopefully)
1 parent 0e18be4 commit ce29c19

10 files changed

Lines changed: 16 additions & 10 deletions

File tree

meta/src/meta/grammar.y

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ iceberg_to_snapshot
11821182

11831183
iceberg_data
11841184
: "(" "iceberg_data" iceberg_locator iceberg_config gnf_columns iceberg_to_snapshot? ")"
1185-
construct: $$ = logic.IcebergData(locator=$3, config=$4, columns=$5, to_snapshot=$6)
1185+
construct: $$ = logic.IcebergData(locator=$3, config=$4, columns=$5, to_snapshot=builtin.some(builtin.unwrap_option_or($6, "")))
11861186
deconstruct:
11871187
$3: logic.IcebergLocator = $$.locator
11881188
$4: logic.IcebergConfig = $$.config
@@ -1645,20 +1645,20 @@ def construct_iceberg_config(
16451645
auth_props: Dict[String, String] = builtin.string_map_from_pairs(auth_property_pairs)
16461646
return logic.IcebergConfig(
16471647
catalog_uri=catalog_uri,
1648-
scope=scope_opt,
1648+
scope=builtin.some(builtin.unwrap_option_or(scope_opt, "")),
16491649
properties=props,
16501650
auth_properties=auth_props,
16511651
)
16521652

16531653

16541654
def deconstruct_iceberg_config_scope_optional(msg: logic.IcebergConfig) -> Optional[String]:
1655-
if builtin.has_proto_field(msg, "scope"):
1655+
if builtin.unwrap_option(msg.scope) != "":
16561656
return builtin.some(builtin.unwrap_option(msg.scope))
16571657
return builtin.none()
16581658

16591659

16601660
def deconstruct_iceberg_data_to_snapshot_optional(msg: logic.IcebergData) -> Optional[String]:
1661-
if builtin.has_proto_field(msg, "to_snapshot"):
1661+
if builtin.unwrap_option(msg.to_snapshot) != "":
16621662
return builtin.some(builtin.unwrap_option(msg.to_snapshot))
16631663
return builtin.none()
16641664

sdks/go/src/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ func (p *Parser) construct_export_csv_config_with_source(path string, csv_source
858858
func (p *Parser) construct_iceberg_config(catalog_uri string, scope_opt *string, property_pairs [][]interface{}, auth_property_pairs [][]interface{}) *pb.IcebergConfig {
859859
props := stringMapFromPairs(property_pairs)
860860
auth_props := stringMapFromPairs(auth_property_pairs)
861-
_t2097 := &pb.IcebergConfig{CatalogUri: catalog_uri, Scope: scope_opt, Properties: props, AuthProperties: auth_props}
861+
_t2097 := &pb.IcebergConfig{CatalogUri: catalog_uri, Scope: ptr(deref(scope_opt, "")), Properties: props, AuthProperties: auth_props}
862862
return _t2097
863863
}
864864

@@ -4378,7 +4378,7 @@ func (p *Parser) parse_iceberg_data() *pb.IcebergData {
43784378
}
43794379
iceberg_to_snapshot1184 := _t1953
43804380
p.consumeLiteral(")")
4381-
_t1955 := &pb.IcebergData{Locator: iceberg_locator1181, Config: iceberg_config1182, Columns: gnf_columns1183, ToSnapshot: iceberg_to_snapshot1184}
4381+
_t1955 := &pb.IcebergData{Locator: iceberg_locator1181, Config: iceberg_config1182, Columns: gnf_columns1183, ToSnapshot: ptr(deref(iceberg_to_snapshot1184, ""))}
43824382
result1186 := _t1955
43834383
p.recordSpan(int(span_start1185), "IcebergData")
43844384
return result1186

sdks/julia/LogicalQueryProtocol.jl/src/parser.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ end
567567
function construct_iceberg_config(parser::ParserState, catalog_uri::String, scope_opt::Union{Nothing, String}, property_pairs::Vector{Tuple{String, String}}, auth_property_pairs::Vector{Tuple{String, String}})::Proto.IcebergConfig
568568
props = Dict(property_pairs)
569569
auth_props = Dict(auth_property_pairs)
570-
_t2086 = Proto.IcebergConfig(catalog_uri=catalog_uri, scope=scope_opt, properties=props, auth_properties=auth_props)
570+
_t2086 = Proto.IcebergConfig(catalog_uri=catalog_uri, scope=(!isnothing(scope_opt) ? scope_opt : ""), properties=props, auth_properties=auth_props)
571571
return _t2086
572572
end
573573

@@ -3706,7 +3706,7 @@ function parse_iceberg_data(parser::ParserState)::Proto.IcebergData
37063706
end
37073707
iceberg_to_snapshot1184 = _t1942
37083708
consume_literal!(parser, ")")
3709-
_t1944 = Proto.IcebergData(locator=iceberg_locator1181, config=iceberg_config1182, columns=gnf_columns1183, to_snapshot=iceberg_to_snapshot1184)
3709+
_t1944 = Proto.IcebergData(locator=iceberg_locator1181, config=iceberg_config1182, columns=gnf_columns1183, to_snapshot=(!isnothing(iceberg_to_snapshot1184) ? iceberg_to_snapshot1184 : ""))
37103710
result1186 = _t1944
37113711
record_span!(parser, span_start1185, "IcebergData")
37123712
return result1186

sdks/python/src/lqp/gen/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def construct_export_csv_config_with_source(self, path: str, csv_source: transac
646646
def construct_iceberg_config(self, catalog_uri: str, scope_opt: str | None, property_pairs: Sequence[tuple[str, str]], auth_property_pairs: Sequence[tuple[str, str]]) -> logic_pb2.IcebergConfig:
647647
props = dict(property_pairs)
648648
auth_props = dict(auth_property_pairs)
649-
_t2095 = logic_pb2.IcebergConfig(catalog_uri=catalog_uri, scope=scope_opt, properties=props, auth_properties=auth_props)
649+
_t2095 = logic_pb2.IcebergConfig(catalog_uri=catalog_uri, scope=(scope_opt if scope_opt is not None else ""), properties=props, auth_properties=auth_props)
650650
return _t2095
651651

652652
def construct_export_iceberg_config_full(self, locator: logic_pb2.IcebergLocator, config: logic_pb2.IcebergConfig, columns: Sequence[transactions_pb2.IcebergExportColumn], config_dict: Sequence[tuple[str, logic_pb2.Value]] | None) -> transactions_pb2.ExportIcebergConfig:
@@ -3385,7 +3385,7 @@ def parse_iceberg_data(self) -> logic_pb2.IcebergData:
33853385
_t1942 = None
33863386
iceberg_to_snapshot1184 = _t1942
33873387
self.consume_literal(")")
3388-
_t1944 = logic_pb2.IcebergData(locator=iceberg_locator1181, config=iceberg_config1182, columns=gnf_columns1183, to_snapshot=iceberg_to_snapshot1184)
3388+
_t1944 = logic_pb2.IcebergData(locator=iceberg_locator1181, config=iceberg_config1182, columns=gnf_columns1183, to_snapshot=(iceberg_to_snapshot1184 if iceberg_to_snapshot1184 is not None else ""))
33893389
result1186 = _t1944
33903390
self.record_span(span_start1185, "IcebergData")
33913391
return result1186

tests/bin/iceberg_data.bin

2 Bytes
Binary file not shown.

tests/bin/iceberg_export.bin

4 Bytes
Binary file not shown.

tests/pretty/iceberg_data.lqp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
(
2222
catalog_uri
2323
"https://catalog.example")
24+
(scope "")
2425
(
2526
properties
2627
(prop "type" "rest"))

tests/pretty/iceberg_export.lqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
(
3030
catalog_uri
3131
"https://catalog.example.com")
32+
(scope "")
3233
(
3334
properties)
3435
(
@@ -83,6 +84,7 @@ columns
8384
(
8485
catalog_uri
8586
"https://catalog.example.com")
87+
(scope "")
8688
(
8789
properties)
8890
(

tests/pretty_debug/iceberg_data.lqp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
(
2222
catalog_uri
2323
"https://catalog.example")
24+
(scope "")
2425
(
2526
properties
2627
(prop "type" "rest"))

tests/pretty_debug/iceberg_export.lqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
(
3030
catalog_uri
3131
"https://catalog.example.com")
32+
(scope "")
3233
(
3334
properties)
3435
(
@@ -83,6 +84,7 @@ columns
8384
(
8485
catalog_uri
8586
"https://catalog.example.com")
87+
(scope "")
8688
(
8789
properties)
8890
(

0 commit comments

Comments
 (0)