Skip to content

Commit 892c99b

Browse files
committed
tests + make update-bins + make update-snapshots
1 parent c97f4d6 commit 892c99b

8 files changed

Lines changed: 235 additions & 82 deletions

File tree

tests/bin/iceberg_data.bin

146 Bytes
Binary file not shown.

tests/bin/iceberg_export.bin

68 Bytes
Binary file not shown.

tests/lqp/iceberg_data.lqp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(transaction
2+
(epoch
3+
(writes
4+
(define
5+
(fragment :f1
6+
(iceberg_data
7+
(iceberg_locator
8+
(table_name "events")
9+
(namespace "analytics" "raw")
10+
(warehouse "wh"))
11+
(iceberg_config
12+
(catalog_uri "https://catalog.example")
13+
(properties (prop "type" "rest"))
14+
(auth_properties (prop "token" "random token")))
15+
(columns
16+
(column "id" [INT]))
17+
(to_snapshot "snap-abc")))))))

tests/lqp/iceberg_export.lqp

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,52 @@
99
(and (= id 1) (= region "us-east") (= amount 100.0))
1010
(and (= id 2) (= region "eu-west") (= amount 250.5))))))))
1111
(reads
12-
;; Minimal config (warehouse only, no optional catalog/export fields)
12+
;; Minimal export
1313
(export_iceberg
1414
(export_iceberg_config
15-
(catalog_uri "https://catalog.example.com")
16-
(namespace "db" "schema")
17-
(table_name "sales")
18-
(catalog_properties
15+
(iceberg_locator
16+
(table_name "sales")
17+
(namespace "db" "schema")
1918
(warehouse "s3://bucket/warehouse"))
20-
(schema "id:int,region:string,amount:float")))
19+
(iceberg_config
20+
(catalog_uri "https://catalog.example.com")
21+
(properties)
22+
(auth_properties))
23+
(columns
24+
(iceberg_column "id" INT false)
25+
(iceberg_column "region" STRING false)
26+
(iceberg_column "amount" FLOAT false))))
2127

22-
;; Full config with all optional fields
28+
;; Full export with scope, property maps, and trailing export options
2329
(export_iceberg
2430
(export_iceberg_config
25-
(catalog_uri "https://catalog.example.com")
26-
(namespace "production")
27-
(table_name "sales_archive")
28-
(catalog_properties
29-
(warehouse "s3://bucket/warehouse")
30-
{:token "secret-token-123" :credential "my-credential"})
31-
(schema "id:int,region:string,amount:float")
31+
(iceberg_locator
32+
(table_name "sales_archive")
33+
(namespace "production")
34+
(warehouse "s3://bucket/warehouse"))
35+
(iceberg_config
36+
(catalog_uri "https://catalog.example.com")
37+
(scope "read-only")
38+
(properties (prop "client.region" "us-east-1"))
39+
(auth_properties
40+
(prop "credential" "my-credential")
41+
(prop "token" "secret-token-123")))
42+
(columns
43+
(iceberg_column "id" INT false)
44+
(iceberg_column "region" STRING false)
45+
(iceberg_column "amount" FLOAT false))
3246
{:prefix "part" :target_file_size_bytes 268435456 :compression "SNAPPY"}))
3347

34-
;; Empty namespace
48+
;; Empty namespace on the locator
3549
(export_iceberg
3650
(export_iceberg_config
37-
(catalog_uri "https://catalog.example.com")
38-
(namespace)
39-
(table_name "flat_table")
40-
(catalog_properties
51+
(iceberg_locator
52+
(table_name "flat_table")
53+
(namespace)
4154
(warehouse "s3://bucket/default"))
42-
(schema "id:int"))))))
55+
(iceberg_config
56+
(catalog_uri "https://catalog.example.com")
57+
(properties)
58+
(auth_properties))
59+
(columns
60+
(iceberg_column "id" INT false)))))))

tests/pretty/iceberg_data.lqp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(transaction
2+
(configure { :ivm.maintenance_level "off" :semantics_version 0})
3+
(epoch
4+
(writes
5+
(define
6+
(fragment
7+
:f1
8+
(iceberg_data
9+
(iceberg_locator
10+
(
11+
table_name
12+
"events")
13+
(
14+
namespace
15+
"analytics"
16+
"raw")
17+
(
18+
warehouse
19+
"wh"))
20+
(iceberg_config
21+
(
22+
catalog_uri
23+
"https://catalog.example")
24+
(
25+
properties
26+
(prop "type" "rest"))
27+
(
28+
auth_properties
29+
(prop "token" "random token")))
30+
(columns (column "id" [INT]))
31+
(to_snapshot "snap-abc")))))))

tests/pretty/iceberg_export.lqp

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,79 @@
1414
(reads
1515
(export_iceberg
1616
(export_iceberg_config
17+
(iceberg_locator
18+
(
19+
table_name
20+
"sales")
1721
(
18-
catalog_uri
19-
"https://catalog.example.com")
22+
namespace
23+
"db"
24+
"schema")
2025
(
21-
namespace
22-
"db"
23-
"schema")
26+
warehouse
27+
"s3://bucket/warehouse"))
28+
(iceberg_config
2429
(
25-
table_name
26-
"sales")
27-
(catalog_properties ( warehouse "s3://bucket/warehouse"))
30+
catalog_uri
31+
"https://catalog.example.com")
2832
(
29-
schema
30-
"id:int,region:string,amount:float")))
33+
properties)
34+
(
35+
auth_properties))
36+
(
37+
columns
38+
(iceberg_column "id" INT false)
39+
(iceberg_column "region" STRING false)
40+
(iceberg_column "amount" FLOAT false))))
3141
(export_iceberg
3242
(export_iceberg_config
43+
(iceberg_locator
44+
(
45+
table_name
46+
"sales_archive")
3347
(
34-
catalog_uri
35-
"https://catalog.example.com")
36-
(
37-
namespace
38-
"production")
39-
(
40-
table_name
41-
"sales_archive")
42-
(catalog_properties
48+
namespace
49+
"production")
4350
(
4451
warehouse
45-
"s3://bucket/warehouse")
46-
{ :credential "my-credential" :token "secret-token-123"})
52+
"s3://bucket/warehouse"))
53+
(iceberg_config
54+
(
55+
catalog_uri
56+
"https://catalog.example.com")
57+
(scope "read-only")
4758
(
48-
schema
49-
"id:int,region:string,amount:float")
59+
properties
60+
(prop "client.region" "us-east-1"))
61+
(
62+
auth_properties
63+
(prop "credential" "my-credential")
64+
(prop "token" "secret-token-123")))
65+
(
66+
columns
67+
(iceberg_column "id" INT false)
68+
(iceberg_column "region" STRING false)
69+
(iceberg_column "amount" FLOAT false))
5070
{ :compression "SNAPPY" :prefix "part" :target_file_size_bytes 268435456}))
5171
(export_iceberg
5272
(export_iceberg_config
73+
(iceberg_locator
74+
(
75+
table_name
76+
"flat_table")
5377
(
54-
catalog_uri
55-
"https://catalog.example.com")
78+
namespace)
5679
(
57-
namespace)
80+
warehouse
81+
"s3://bucket/default"))
82+
(iceberg_config
83+
(
84+
catalog_uri
85+
"https://catalog.example.com")
86+
(
87+
properties)
5888
(
59-
table_name
60-
"flat_table")
61-
(catalog_properties ( warehouse "s3://bucket/default"))
89+
auth_properties))
6290
(
63-
schema
64-
"id:int"))))))
91+
columns
92+
(iceberg_column "id" INT false)))))))
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(transaction
2+
(configure { :ivm.maintenance_level "off" :semantics_version 0})
3+
(epoch
4+
(writes
5+
(define
6+
(fragment
7+
:f1
8+
(iceberg_data
9+
(iceberg_locator
10+
(
11+
table_name
12+
"events")
13+
(
14+
namespace
15+
"analytics"
16+
"raw")
17+
(
18+
warehouse
19+
"wh"))
20+
(iceberg_config
21+
(
22+
catalog_uri
23+
"https://catalog.example")
24+
(
25+
properties
26+
(prop "type" "rest"))
27+
(
28+
auth_properties
29+
(prop "token" "random token")))
30+
(columns (column "id" [INT]))
31+
(to_snapshot "snap-abc")))))))

tests/pretty_debug/iceberg_export.lqp

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,82 @@
1414
(reads
1515
(export_iceberg
1616
(export_iceberg_config
17+
(iceberg_locator
18+
(
19+
table_name
20+
"sales")
1721
(
18-
catalog_uri
19-
"https://catalog.example.com")
22+
namespace
23+
"db"
24+
"schema")
2025
(
21-
namespace
22-
"db"
23-
"schema")
26+
warehouse
27+
"s3://bucket/warehouse"))
28+
(iceberg_config
2429
(
25-
table_name
26-
"sales")
27-
(catalog_properties ( warehouse "s3://bucket/warehouse"))
30+
catalog_uri
31+
"https://catalog.example.com")
2832
(
29-
schema
30-
"id:int,region:string,amount:float")))
33+
properties)
34+
(
35+
auth_properties))
36+
(
37+
columns
38+
(iceberg_column "id" INT false)
39+
(iceberg_column "region" STRING false)
40+
(iceberg_column "amount" FLOAT false))))
3141
(export_iceberg
3242
(export_iceberg_config
43+
(iceberg_locator
44+
(
45+
table_name
46+
"sales_archive")
3347
(
34-
catalog_uri
35-
"https://catalog.example.com")
36-
(
37-
namespace
38-
"production")
39-
(
40-
table_name
41-
"sales_archive")
42-
(catalog_properties
48+
namespace
49+
"production")
4350
(
4451
warehouse
45-
"s3://bucket/warehouse")
46-
{ :credential "my-credential" :token "secret-token-123"})
52+
"s3://bucket/warehouse"))
53+
(iceberg_config
54+
(
55+
catalog_uri
56+
"https://catalog.example.com")
57+
(scope "read-only")
4758
(
48-
schema
49-
"id:int,region:string,amount:float")
59+
properties
60+
(prop "client.region" "us-east-1"))
61+
(
62+
auth_properties
63+
(prop "credential" "my-credential")
64+
(prop "token" "secret-token-123")))
65+
(
66+
columns
67+
(iceberg_column "id" INT false)
68+
(iceberg_column "region" STRING false)
69+
(iceberg_column "amount" FLOAT false))
5070
{ :compression "SNAPPY" :prefix "part" :target_file_size_bytes 268435456}))
5171
(export_iceberg
5272
(export_iceberg_config
73+
(iceberg_locator
74+
(
75+
table_name
76+
"flat_table")
5377
(
54-
catalog_uri
55-
"https://catalog.example.com")
78+
namespace)
5679
(
57-
namespace)
80+
warehouse
81+
"s3://bucket/default"))
82+
(iceberg_config
83+
(
84+
catalog_uri
85+
"https://catalog.example.com")
86+
(
87+
properties)
5888
(
59-
table_name
60-
"flat_table")
61-
(catalog_properties ( warehouse "s3://bucket/default"))
89+
auth_properties))
6290
(
63-
schema
64-
"id:int"))))))
91+
columns
92+
(iceberg_column "id" INT false)))))))
6593

6694
;; Debug information
6795
;; -----------------------

0 commit comments

Comments
 (0)