Skip to content

Commit d3efe0b

Browse files
committed
add tmp location
1 parent 7fbbba1 commit d3efe0b

File tree

1 file changed

+59
-55
lines changed

1 file changed

+59
-55
lines changed

sdks/python/apache_beam/yaml/extended_tests/databases/bigquery_dynamic_destinations.yaml

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ fixtures:
2020
type: "apache_beam.yaml.integration_tests.temp_bigquery_table"
2121
config:
2222
project: "apache-beam-testing"
23+
- name: TEMP_DIR_0
24+
# Need distributed filesystem to be able to read and write from a container.
25+
type: "apache_beam.yaml.integration_tests.gcs_temp_dir"
26+
config:
27+
bucket: "gs://temp-storage-for-end-to-end-tests/temp-it"
2328

2429
pipelines:
2530
- pipeline:
@@ -33,61 +38,60 @@ pipelines:
3338
- {id: 2, name: "Bob", country: "UK"}
3439
- {id: 3, name: "Charlie", country: "CN"}
3540
- {id: 4, name: "David", country: "US"}
36-
# Blocked by https://github.com/apache/beam/issues/30950
37-
# - type: WriteToBigQuery
38-
# name: WriteWithDynamicDestinations
39-
# config:
40-
# # NOTE: This will create 3 tables: BQ_TABLE_US, BQ_TABLE_UK, BQ_TABLE_CN
41-
# # This is because the table name is dynamically generated using the country field.
42-
# # The {{country}} syntax is used to dynamically generate the table name.
43-
# # For this testing example we are using {{country}} to dynamically generate the table name.
44-
# # In production, we would use {country} to dynamically generate the table name.
45-
# table: "{BQ_TABLE}_{{country}}"
46-
# create_disposition: CREATE_IF_NEEDED
47-
# write_disposition: WRITE_APPEND
48-
# options:
49-
# project: "apache-beam-testing"
50-
# temp_location: "gs://temp-storage-for-end-to-end-tests/temp-it"
41+
- type: WriteToBigQuery
42+
name: WriteWithDynamicDestinations
43+
config:
44+
# NOTE: This will create 3 tables: BQ_TABLE_US, BQ_TABLE_UK, BQ_TABLE_CN
45+
# This is because the table name is dynamically generated using the country field.
46+
# The {{country}} syntax is used to dynamically generate the table name.
47+
# For this testing example we are using {{country}} to dynamically generate the table name.
48+
# In production, we would use {country} to dynamically generate the table name.
49+
table: "{BQ_TABLE}_{{country}}"
50+
create_disposition: CREATE_IF_NEEDED
51+
write_disposition: WRITE_APPEND
52+
options:
53+
project: "apache-beam-testing"
54+
temp_location: "{TEMP_DIR_0}"
5155

52-
# - pipeline:
53-
# type: chain
54-
# transforms:
55-
# - type: ReadFromBigQuery
56-
# config:
57-
# table: "{BQ_TABLE}_US"
58-
# - type: AssertEqual
59-
# config:
60-
# elements:
61-
# - {id: 1, name: "Alice", country: "US"}
62-
# - {id: 4, name: "David", country: "US"}
63-
# options:
64-
# project: "apache-beam-testing"
65-
# temp_location: "gs://temp-storage-for-end-to-end-tests/temp-it"
56+
- pipeline:
57+
type: chain
58+
transforms:
59+
- type: ReadFromBigQuery
60+
config:
61+
table: "{BQ_TABLE}_US"
62+
- type: AssertEqual
63+
config:
64+
elements:
65+
- {id: 1, name: "Alice", country: "US"}
66+
- {id: 4, name: "David", country: "US"}
67+
options:
68+
project: "apache-beam-testing"
69+
temp_location: "{TEMP_DIR_0}"
6670

67-
# - pipeline:
68-
# type: chain
69-
# transforms:
70-
# - type: ReadFromBigQuery
71-
# config:
72-
# table: "{BQ_TABLE}_UK"
73-
# - type: AssertEqual
74-
# config:
75-
# elements:
76-
# - {id: 2, name: "Bob", country: "UK"}
77-
# options:
78-
# project: "apache-beam-testing"
79-
# temp_location: "gs://temp-storage-for-end-to-end-tests/temp-it"
71+
- pipeline:
72+
type: chain
73+
transforms:
74+
- type: ReadFromBigQuery
75+
config:
76+
table: "{BQ_TABLE}_UK"
77+
- type: AssertEqual
78+
config:
79+
elements:
80+
- {id: 2, name: "Bob", country: "UK"}
81+
options:
82+
project: "apache-beam-testing"
83+
temp_location: "{TEMP_DIR_0}"
8084

81-
# - pipeline:
82-
# type: chain
83-
# transforms:
84-
# - type: ReadFromBigQuery
85-
# config:
86-
# table: "{BQ_TABLE}_CN"
87-
# - type: AssertEqual
88-
# config:
89-
# elements:
90-
# - {id: 3, name: "Charlie", country: "CN"}
91-
# options:
92-
# project: "apache-beam-testing"
93-
# temp_location: "gs://temp-storage-for-end-to-end-tests/temp-it"
85+
- pipeline:
86+
type: chain
87+
transforms:
88+
- type: ReadFromBigQuery
89+
config:
90+
table: "{BQ_TABLE}_CN"
91+
- type: AssertEqual
92+
config:
93+
elements:
94+
- {id: 3, name: "Charlie", country: "CN"}
95+
options:
96+
project: "apache-beam-testing"
97+
temp_location: "{TEMP_DIR_0}"

0 commit comments

Comments
 (0)