-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add BigTable source format in BigQuery tables #4155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
bf4a252
828eb0a
f503762
4e6bf18
0fdd96b
137dff6
d9a0a51
a1c8a93
05336e5
552aa0e
e992d4e
7c848b2
7eb6f1d
194aeb7
2973a68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -416,6 +416,30 @@ func TestAccBigQueryDataTable_sheet(t *testing.T) { | |
| }) | ||
| } | ||
|
|
||
| func TestAccBigQueryDataTable_bigtable(t *testing.T) { | ||
|
||
| t.Parallel() | ||
|
|
||
| context := map[string]interface{}{ | ||
| "random_suffix": randString(t, 10), | ||
| } | ||
|
|
||
| vcrTest(t, resource.TestCase{ | ||
| PreCheck: func() { testAccPreCheck(t) }, | ||
| Providers: testAccProviders, | ||
| CheckDestroy: testAccCheckBigQueryTableDestroyProducer(t), | ||
| Steps: []resource.TestStep{ | ||
| { | ||
| Config: testAccBigQueryTableFromBigtable(context), | ||
|
||
| }, | ||
| { | ||
| ResourceName: "google_bigquery_table.table", | ||
| ImportState: true, | ||
| ImportStateVerify: true, | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func testAccCheckBigQueryExtData(t *testing.T, expectedQuoteChar string) resource.TestCheckFunc { | ||
| return func(s *terraform.State) error { | ||
| for _, rs := range s.RootModule().Resources { | ||
|
|
@@ -1048,6 +1072,37 @@ func testAccBigQueryTableFromSheet(context map[string]interface{}) string { | |
| `, context) | ||
| } | ||
|
|
||
| func testAccBigQueryTableFromBigtable(context map[string]interface{}) string { | ||
| return Nprintf(` | ||
| resource "google_bigquery_table" "table" { | ||
| dataset_id = google_bigquery_dataset.dataset.dataset_id | ||
| table_id = "tf_test_bigtable_%{random_suffix}" | ||
|
|
||
| external_data_configuration { | ||
| autodetect = true | ||
| source_format = "BIGTABLE" | ||
| ignore_unknown_values = true | ||
|
|
||
| source_uris = [ | ||
| "https://googleapis.com/bigtable/projects/project_id/instances/instance_id/tables/table_name", | ||
|
||
| ] | ||
| } | ||
| } | ||
|
|
||
| resource "google_bigquery_dataset" "dataset" { | ||
| dataset_id = "tf_test_ds_%{random_suffix}" | ||
| friendly_name = "test" | ||
| description = "This is a test description" | ||
| location = "EU" | ||
| default_table_expiration_ms = 3600000 | ||
|
|
||
| labels = { | ||
| env = "default" | ||
| } | ||
| } | ||
| `, context) | ||
| } | ||
|
|
||
| var TEST_CSV = `lifelock,LifeLock,,web,Tempe,AZ,1-May-07,6850000,USD,b | ||
| lifelock,LifeLock,,web,Tempe,AZ,1-Oct-06,6000000,USD,a | ||
| lifelock,LifeLock,,web,Tempe,AZ,1-Jan-08,25000000,USD,c | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder
ORCcan also included in the source_format list ?. We have an open issue (hashicorp/terraform-provider-google#7691) for that type.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry but that's out of scope for this PR - adding it in the list is trivial but requires to write the tests.