Skip to content

Commit c503e71

Browse files
authored
Add constraings to bindings (#4867)
1 parent 8f381d4 commit c503e71

File tree

2 files changed

+144
-0
lines changed

2 files changed

+144
-0
lines changed

ydb/library/benchmarks/gen_queries/bindings_tpcds.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"path": "{{data}}/call_center/",
55
"cluster": "yq-tpc-local",
66
"format": "parquet",
7+
"constraints": {
8+
"primary_key": ["cc_call_center_sk"]
9+
},
710
"schema": [
811
"StructType", [
912
["cc_call_center_id", ["OptionalType", ["DataType", "String"]]],
@@ -45,6 +48,9 @@
4548
"path": "{{data}}/catalog_page/",
4649
"cluster": "yq-tpc-local",
4750
"format": "parquet",
51+
"constraints": {
52+
"primary_key": ["cp_catalog_page_sk"]
53+
},
4854
"schema": [
4955
"StructType", [
5056
["cp_catalog_number", ["OptionalType", ["DataType", "Int32"]]],
@@ -64,6 +70,9 @@
6470
"path": "{{data}}/catalog_returns/",
6571
"cluster": "yq-tpc-local",
6672
"format": "parquet",
73+
"constraints": {
74+
"primary_key": ["cr_item_sk", "cr_order_number"]
75+
},
6776
"schema": [
6877
"StructType", [
6978
["cr_call_center_sk", ["OptionalType", ["DataType", "Int32"]]],
@@ -101,6 +110,9 @@
101110
"path": "{{data}}/catalog_sales/",
102111
"cluster": "yq-tpc-local",
103112
"format": "parquet",
113+
"constraints": {
114+
"primary_key": ["cs_item_sk", "cs_order_number"]
115+
},
104116
"schema": [
105117
"StructType", [
106118
["cs_bill_addr_sk",["OptionalType",["DataType","Int32"]]],
@@ -145,6 +157,9 @@
145157
"path": "{{data}}/customer/",
146158
"cluster": "yq-tpc-local",
147159
"format": "parquet",
160+
"constraints": {
161+
"primary_key": ["c_customer_sk"]
162+
},
148163
"schema": [
149164
"StructType", [
150165
["c_birth_country",["OptionalType",["DataType","String"]]],
@@ -173,6 +188,9 @@
173188
"path": "{{data}}/customer_address/",
174189
"cluster": "yq-tpc-local",
175190
"format": "parquet",
191+
"constraints": {
192+
"primary_key": ["ca_address_sk"]
193+
},
176194
"schema": [
177195
"StructType", [
178196
["ca_address_id",["OptionalType",["DataType","String"]]],
@@ -196,6 +214,9 @@
196214
"path": "{{data}}/customer_demographics/",
197215
"cluster": "yq-tpc-local",
198216
"format": "parquet",
217+
"constraints": {
218+
"primary_key": ["cd_demo_sk"]
219+
},
199220
"schema": [
200221
"StructType", [
201222
["cd_credit_rating",["OptionalType",["DataType","String"]]],
@@ -215,6 +236,9 @@
215236
"path": "{{data}}/date_dim/",
216237
"cluster": "yq-tpc-local",
217238
"format": "parquet",
239+
"constraints": {
240+
"primary_key": ["d_date_sk"]
241+
},
218242
"schema": [
219243
"StructType", [
220244
["d_current_day",["OptionalType",["DataType","String"]]],
@@ -253,6 +277,9 @@
253277
"path": "{{data}}/household_demographics/",
254278
"cluster": "yq-tpc-local",
255279
"format": "parquet",
280+
"constraints": {
281+
"primary_key": ["hd_demo_sk"]
282+
},
256283
"schema": [
257284
"StructType", [
258285
["hd_buy_potential",["OptionalType",["DataType","String"]]],
@@ -268,6 +295,9 @@
268295
"path": "{{data}}/income_band/",
269296
"cluster": "yq-tpc-local",
270297
"format": "parquet",
298+
"constraints": {
299+
"primary_key": ["ib_income_band_sk"]
300+
},
271301
"schema": [
272302
"StructType", [
273303
["ib_income_band_sk",["OptionalType",["DataType","Int32"]]],
@@ -281,6 +311,9 @@
281311
"path": "{{data}}/inventory/",
282312
"cluster": "yq-tpc-local",
283313
"format": "parquet",
314+
"constraints": {
315+
"primary_key": ["inv_date_sk", "inv_item_sk", "inv_warehouse_sk"]
316+
},
284317
"schema": [
285318
"StructType", [
286319
["inv_date_sk",["OptionalType",["DataType","Int32"]]],
@@ -295,6 +328,9 @@
295328
"path": "{{data}}/item/",
296329
"cluster": "yq-tpc-local",
297330
"format": "parquet",
331+
"constraints": {
332+
"primary_key": ["i_item_sk"]
333+
},
298334
"schema": [
299335
"StructType", [
300336
["i_brand",["OptionalType",["DataType","String"]]],
@@ -327,6 +363,9 @@
327363
"path": "{{data}}/promotion/",
328364
"cluster": "yq-tpc-local",
329365
"format": "parquet",
366+
"constraints": {
367+
"primary_key": ["p_promo_sk"]
368+
},
330369
"schema": [
331370
"StructType", [
332371
["p_channel_catalog",["OptionalType",["DataType","String"]]],
@@ -356,6 +395,9 @@
356395
"path": "{{data}}/reason/",
357396
"cluster": "yq-tpc-local",
358397
"format": "parquet",
398+
"constraints": {
399+
"primary_key": ["r_reason_sk"]
400+
},
359401
"schema": [
360402
"StructType", [
361403
["r_reason_desc",["OptionalType",["DataType","String"]]],
@@ -369,6 +411,9 @@
369411
"path": "{{data}}/ship_mode/",
370412
"cluster": "yq-tpc-local",
371413
"format": "parquet",
414+
"constrains": {
415+
"primary_key": ["sm_ship_mode_sk"]
416+
},
372417
"schema": [
373418
"StructType", [
374419
["sm_carrier",["OptionalType",["DataType","String"]]],
@@ -385,6 +430,9 @@
385430
"path": "{{data}}/store/",
386431
"cluster": "yq-tpc-local",
387432
"format": "parquet",
433+
"constraints": {
434+
"primary_key": ["s_store_sk"]
435+
},
388436
"schema": [
389437
"StructType", [
390438
["s_city",["OptionalType",["DataType","String"]]],
@@ -424,6 +472,9 @@
424472
"path": "{{data}}/store_returns/",
425473
"cluster": "yq-tpc-local",
426474
"format": "parquet",
475+
"constraints": {
476+
"primary_keys": ["sr_item_sk", "sr_ticket_number"]
477+
},
427478
"schema": [
428479
"StructType", [
429480
["sr_addr_sk",["OptionalType",["DataType","Int32"]]],
@@ -454,6 +505,9 @@
454505
"path": "{{data}}/store_sales/",
455506
"cluster": "yq-tpc-local",
456507
"format": "parquet",
508+
"constraints": {
509+
"primary_key": ["ss_item_sk", "ss_ticket_number"]
510+
},
457511
"schema": [
458512
"StructType", [
459513
["ss_addr_sk",["OptionalType",["DataType","Int32"]]],
@@ -487,6 +541,9 @@
487541
"path": "{{data}}/time_dim/",
488542
"cluster": "yq-tpc-local",
489543
"format": "parquet",
544+
"constraints": {
545+
"primary_key": ["t_time_sk"]
546+
},
490547
"schema": [
491548
"StructType", [
492549
["t_am_pm",["OptionalType",["DataType","String"]]],
@@ -507,6 +564,9 @@
507564
"path": "{{data}}/warehouse/",
508565
"cluster": "yq-tpc-local",
509566
"format": "parquet",
567+
"constraints": {
568+
"primary_keys": ["w_warehouse_sk"]
569+
},
510570
"schema": [
511571
"StructType", [
512572
["w_city",["OptionalType",["DataType","String"]]],
@@ -531,6 +591,9 @@
531591
"path": "{{data}}/web_page/",
532592
"cluster": "yq-tpc-local",
533593
"format": "parquet",
594+
"constraints": {
595+
"primary_key": ["wp_web_page_sk"]
596+
},
534597
"schema": [
535598
"StructType", [
536599
["wp_access_date_sk",["OptionalType",["DataType","Int32"]]],
@@ -555,6 +618,9 @@
555618
"path": "{{data}}/web_returns/",
556619
"cluster": "yq-tpc-local",
557620
"format": "parquet",
621+
"constraints": {
622+
"primary_key": ["wr_item_sk", "wr_order_number"]
623+
},
558624
"schema": [
559625
"StructType", [
560626
["wr_account_credit",["OptionalType",["DataType","Double"]]],
@@ -589,6 +655,9 @@
589655
"path": "{{data}}/web_sales/",
590656
"cluster": "yq-tpc-local",
591657
"format": "parquet",
658+
"constraints": {
659+
"primary_key": ["ws_item_sk", "ws_order_number"]
660+
},
592661
"schema": [
593662
"StructType", [
594663
["ws_bill_addr_sk",["OptionalType",["DataType","Int32"]]],
@@ -633,6 +702,9 @@
633702
"path": "{{data}}/web_site/",
634703
"cluster": "yq-tpc-local",
635704
"format": "parquet",
705+
"constraints": {
706+
"primary_keys": ["web_site_sk"]
707+
},
636708
"schema": [
637709
"StructType", [
638710
["web_city",["OptionalType",["DataType","String"]]],

0 commit comments

Comments
 (0)