-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add BigTable source format in BigQuery tables #4155
Add BigTable source format in BigQuery tables #4155
Conversation
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @slevenick, please review this PR or find an appropriate assignee. |
CheckDestroy: testAccCheckBigQueryTableDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccBigQueryTableFromBigtable(context), |
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.
Looks like this doesn't match the function declaration, causing this error:
google-beta/resource_bigquery_table_test.go:432:13: undefined: testAccBigQueryTableFromBigtable
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.
oops, thanks!
Should be fixed now.
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=155026" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSpannerInstance_basic|TestAccBigqueryDataTransferConfig|TestAccBigQueryDataTable_bigtable You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=155032" |
ignore_unknown_values = true | ||
|
||
source_uris = [ | ||
"https://googleapis.com/bigtable/projects/project_id/instances/instance_id/tables/table_name", |
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.
Looks like this is causing an error during testing. This is an invalid source, maybe try using one of the source_uris from another test?
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'll try to create a bigtable in the test & generate the URI.
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.
@slevenick that's added but I'm unable to run the tests - can you please try again?
@@ -416,6 +416,30 @@ func TestAccBigQueryDataTable_sheet(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccBigQueryDataTable_bigtable(t *testing.T) { |
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.
This test should only be run for the beta
provider, right? This file may need to be renamed to end in .go.erb
and wrap this test in if/else tags to check the version.
An example can be seen here: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/third_party/terraform/tests/resource_binaryauthorization_policy_test.go.erb#L41
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.
That's quite a weird one actually:
As per my understanding, you can set the format to BIGTABLE in stable (search for sourceFormat in https://bigquery.googleapis.com/discovery/v1/apis/bigquery/v2/rest )
However only 2 regions are supported for the queries https://cloud.google.com/bigquery/external-data-bigtable#supported_regions_and_zones.
From the BigQuery API point of view, I don't think it requires the beta provider.
But from BigTable it does.
Not sure of the preferred approach here.
…gic-modules into feat/add-bigtable-sourceformat
@@ -153,9 +153,9 @@ func resourceBigQueryTable() *schema.Resource { | |||
"source_format": { | |||
Type: schema.TypeString, | |||
Required: true, | |||
Description: `The data format. Supported values are: "CSV", "GOOGLE_SHEETS", "NEWLINE_DELIMITED_JSON", "AVRO", "PARQUET", and "DATASTORE_BACKUP". To use "GOOGLE_SHEETS" the scopes must include "googleapis.com/auth/drive.readonly".`, | |||
Description: `The data format. Supported values are: "CSV", "GOOGLE_SHEETS", "NEWLINE_DELIMITED_JSON", "AVRO", "PARQUET", "DATSTORE_BACKUP", and "BIGTABLE". To use "GOOGLE_SHEETS" the scopes must include "googleapis.com/auth/drive.readonly".`, |
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 ORC
can also included in the source_format list ?. We have an open issue (hashicorp/terraform-provider-google#7691) for that type.
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.
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=155702" |
@slevenick are the tests passing? |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=157044" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGameServicesGameServerDeploymentRollout_basic|TestAccDataSourceSpannerInstance_basic|TestAccApiGatewayApiConfigIamMemberGenerated|TestAccApiGatewayApiConfigIamBindingGenerated|TestAccApiGatewayApiConfigIamPolicyGenerated|TestAccApiGatewayGatewayIamBindingGenerated|TestAccApiGatewayGatewayIamMemberGenerated|TestAccApiGatewayGatewayIamPolicyGenerated|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExample|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExampleUpdated|TestAccApiGatewayGateway_apigatewayGatewayBasicExample|TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated|TestAccBigqueryDataTransferConfig|TestAccBigQueryDataTable_bigtable|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccCloudRunService_cloudRunServiceUpdate|TestAccCloudRunDomainMapping_cloudRunDomainMappingBasicExample|TestAccCloudFunctionsFunction_update|TestAccCloudFunctionsFunction_vpcConnector|TestAccGameServicesGameServerConfig_gameServiceConfigBasicExample|TestAccGameServicesGameServerDeploymentRollout_gameServiceDeploymentRolloutBasicExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=157062" |
instance_name = google_bigtable_instance.instance.name | ||
|
||
column_family { | ||
family = cf-"%{random_suffix}-first" |
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.
Looks like this is incorrect. Quotes should wrap the cf-
.
Error: Missing newline after argument
on config893095785/terraform_plugin_test.tf line 19, in resource "google_bigtable_table" "table":
19: family = cf-"j42ngv1ayb-first"
An argument definition must end with a newline.
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.
sorry for that - fixed now.
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSpannerInstance_basic|TestAccApiGatewayApiConfigIamBindingGenerated|TestAccApiGatewayApiConfigIamMemberGenerated|TestAccApiGatewayApiConfigIamPolicyGenerated|TestAccApiGatewayGatewayIamBindingGenerated|TestAccApiGatewayGatewayIamMemberGenerated|TestAccApiGatewayGatewayIamPolicyGenerated|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExample|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExampleUpdated|TestAccApiGatewayGateway_apigatewayGatewayBasicExample|TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccBigQueryDataTable_bigtable|TestAccBigqueryDataTransferConfig|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccComposerEnvironment_withUpdateOnCreate|TestAccComputeTargetInstance_targetInstanceCustomNetworkExample|TestAccFilestoreInstance_filestoreInstanceBasicExample|TestAccFilestoreInstance_update|TestAccProjectIamCustomRole_basic|TestAccOSLoginSSHPublicKey_osLoginSshKeyExpiry|TestAccSpannerDatabase_basic|TestAccStorageBucket_cors You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=159876" |
@slevenick 👀 |
Looks like that the |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=179544" |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=179546" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceCloudIdentityGroupMemberships_basic|TestAccDataSourceGameServicesGameServerDeploymentRollout_basic|TestAccBigqueryDataTransferConfig|TestAccBigQueryTable_Basic|TestAccBigQueryTable_Kms|TestAccBigQueryTable_HivePartitioning|TestAccBigQueryTable_HourlyTimePartitioning|TestAccBigQueryTable_HivePartitioningCustomSchema|TestAccBigQueryDataTable_bigtable|TestAccBigQueryTable_RangePartitioning|TestAccBigQueryTable_MonthlyTimePartitioning|TestAccBigQueryTable_YearlyTimePartitioning|TestAccBigQueryTable_View|TestAccBigQueryTable_MaterializedView_DailyTimePartioning_Basic|TestAccBigQueryDataTable_sheet|TestAccBigQueryTable_updateView|TestAccBigQueryExternalDataTable_CSV|TestAccBigQueryTable_MaterializedView_DailyTimePartioning_Update|TestAccCloudRunDomainMapping_cloudRunDomainMappingBasicExample|TestAccCloudRunService_cloudRunServiceMultipleEnvironmentVariablesExample|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRegionTargetHttpProxy_regionTargetHttpProxyBasicExample|TestAccComputeTargetInstance_targetInstanceCustomNetworkExample|TestAccNotebooksInstance_notebookInstanceFullExample|TestAccSpannerDatabase_basic You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=179548" |
Tests failed during RECORDING mode: TestAccBigQueryTable_HivePartitioning|TestAccBigQueryTable_HivePartitioningCustomSchema|TestAccBigQueryTable_RangePartitioning|TestAccBigQueryTable_View|TestAccBigQueryTable_HourlyTimePartitioning|TestAccBigQueryTable_Kms|TestAccBigQueryTable_MonthlyTimePartitioning|TestAccBigQueryTable_YearlyTimePartitioning|TestAccBigQueryTable_Basic|TestAccBigQueryDataTable_bigtable|TestAccBigQueryTable_MaterializedView_DailyTimePartioning_Basic|TestAccBigQueryDataTable_sheet|TestAccBigQueryExternalDataTable_CSV|TestAccBigQueryTable_updateView|TestAccBigQueryTable_MaterializedView_DailyTimePartioning_Update|TestAccNotebooksInstance_notebookInstanceFullExample|TestAccCloudFunctionsFunction_vpcConnector Please fix these to complete your PR |
It looks like there are some bad merge issues going on here with the tests. The test file shows a lot of changes that I don't think are associated with your PR. Can you fix that before I can review this again? |
Yes I will, I've noticed the bad diff too. |
2222352
to
e992d4e
Compare
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=179726" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBigQueryDataTable_bigtable|TestAccCloudFunctionsFunction_vpcConnector|TestAccNotebooksInstance_notebookInstanceFullExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=179728" |
Tests failed during RECORDING mode: TestAccBigQueryDataTable_bigtable|TestAccNotebooksInstance_notebookInstanceFullExample Please fix these to complete your PR |
@slevenick Finally tests are passing locally, this is now ready to review. |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=182504" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBigQueryDataTable_bigtable|TestAccCloudRunDomainMapping_foregroundDeletion|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRouterPeer_advertiseMode You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=182505" |
Tests failed during RECORDING mode: TestAccCloudRunDomainMapping_foregroundDeletion Please fix these to complete your PR |
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.
Looks reasonable, thanks!
This is adding the BIGTABLE source format in BigQuery tables.
Fixes hashicorp/terraform-provider-google#7653
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)