Skip to content
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

dataproc metastore - add BQ support #6631

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions mmv1/products/metastore/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,13 @@ objects:
name: 'name'
required: true
description: |
The relative resource name of the metastore that is being federated.
The relative resource name of the metastore that is being federated. The formats of the relative resource names for the currently supported metastores are listed below: Dataplex: projects/{projectId}/locations/{location}/lakes/{lake_id} BigQuery: projects/{projectId} Dataproc Metastore: projects/{projectId}/locations/{location}/services/{serviceId}
- !ruby/object:Api::Type::Enum
name: 'metastoreType'
required: true
description: |
The type of the backend metastore.
values:
- :METASTORE_TYPE_UNSPECIFIED
- :DATAPROC_METASTORE
- :DATAPROC_METASTORE
- :BIGQUERY
7 changes: 7 additions & 0 deletions mmv1/products/metastore/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_name: 'fmt.Sprintf("tf-test-metastore-fed%s", context["random_suffix"])'
vars:
metastore_federation_name: "fed-1"
- !ruby/object:Provider::Terraform::Examples
name: "dataproc_metastore_federation_bigquery"
primary_resource_id: "default"
min_version: beta
primary_resource_name: 'fmt.Sprintf("tf-test-metastore-fed-bq%s", context["random_suffix"])'
vars:
metastore_federation_name: "fed-2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi: these are namespaced in the generated tests by attaching a unique suffix between different test cases! No need to do that here.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ resource "google_dataproc_metastore_federation" "<%= ctx[:primary_resource_id] %
version = "3.1.2"

backend_metastores {
rank = "1"
name = google_dataproc_metastore_service.<%= ctx[:primary_resource_id] %>.id
metastore_type = "DATAPROC_METASTORE"
}
rank = "1"
name = google_dataproc_metastore_service.<%= ctx[:primary_resource_id] %>.id
metastore_type = "DATAPROC_METASTORE"
}
}

resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
resource "google_dataproc_metastore_federation" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
location = "us-central1"
federation_id = "<%= ctx[:vars]['metastore_federation_name'] %>"
version = "3.1.2"

backend_metastores {
rank = "2"
name = data.google_project.project.id
metastore_type = "BIGQUERY"
}

backend_metastores {
rank = "1"
name = google_dataproc_metastore_service.<%= ctx[:primary_resource_id] %>.id
metastore_type = "DATAPROC_METASTORE"
}
}

resource "google_dataproc_metastore_service" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
service_id = "<%= ctx[:vars]['metastore_federation_name'] %>"
location = "us-central1"
tier = "DEVELOPER"


hive_metastore_config {
version = "3.1.2"
endpoint_protocol = "GRPC"
}
}

data "google_project" "project" {
provider = google-beta
}