You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Big Query dataset named Gabriel_Liquibase in the us-central1 region. Not multi-region.
Create a liquibase service account with the BigQuery Admin, BigQuery Data Owner and BigQuery Metadata Viewer roles. (I know this is overkill, but I knee-jerk added more roles when I ran into this error.)
gcloud iam service-accounts keys create "liquibase-service-account-credentials.json" --iam-account "[email protected]"
Use the JSON and SQL from the above gist to create a table and a view:
Try to generate a change log via liquibase generateChangeLog --url 'jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=redacted-project-id;DefaultDataset=Gabriel_Liquibase;OAuthType=0;OAuthServiceAcctEmail=liquibase@redacted-project-id.iam.gserviceaccount.com;OAuthPvtKeyPath=liquibase-service-account-credentials.json' --logLevel DEBUG --changeLogFile changelog.json --driver com.simba.googlebigquery.jdbc.Driver
Expected Behavior
A changelog is created with my table and view.
Actual Behavior
The changelog is not created. liquibase generateChangeLog fails with the below error (see gist for full output). If I use console.cloud.google.com to run the SQL from the error, I do get the expected view definition.
The liquibase generateChangeLog command succeeds if I delete my view.
[2023-05-16 21:39:35] SEVERE [liquibase.integration] Error executing SQL SELECT view_definition FROM Gabriel_Liquibase.INFORMATION_SCHEMA.VIEWS WHERE table_name='Repro_View' AND table_schema='Gabriel_Liquibase' AND table_catalog='redacted-project-id';: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Not found: Dataset redacted-project-id:Gabriel_Liquibase was not found in location US
- Caused by: 404 Not Found
POST https://bigquery.googleapis.com/bigquery/v2/projects/redacted-project-id/queries
{
"code": 404,
"errors": [
{
"domain": "global",
"message": "Not found: Dataset redacted-project-id:Gabriel_Liquibase was not found in location US",
"reason": "notFound"
}
],
"message": "Not found: Dataset redacted-project-id:Gabriel_Liquibase was not found in location US",
"status": "NOT_FOUND"
}
The text was updated successfully, but these errors were encountered:
gabrieldeal
changed the title
generateChangeLog with a view causes "Dataset X:X was not found in location US"
generateChangeLog with a regional dataset and a view causes "Dataset X:X was not found in location US"
May 16, 2023
liquibase-bigquery sets the driver parameter Location with the default value of US if not present, as shown here. I'm not sure if it is really necessary, as the driver docs seems to indicate otherwise.
You can override this parameter in the driver url like --url 'jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=redacted-project-id;DefaultDataset=Gabriel_Liquibase;Location=us-central1'. Note that in this case you will only be able to query datasets in the given region.
…ven (#301)
* Removed the else statement from the open function. Based on the Google Simba driver documentation, the location is automatically handled based on where the dataset exists.
* Removed the location variable that wasn't used and refactored the if condition for the open function.
Community Note
to the original issue to help the community and maintainers prioritize this request
not help prioritize the request
Debug Output
https://gist.github.com/gabrielmdeal/f82a75154fefbade72061d95c6d6fd2d
The gist also contains the
Repro_Table.json
andRepro_View.sql
files that are referenced below.Panic Output
N/A
Steps to Reproduce
TLDR:
liquibase generateChangeLog
fails if my dataset is regional and contains a view. It works for a multi-region dataset.Gabriel_Liquibase
in theus-central1
region. Not multi-region.liquibase
service account with the BigQuery Admin, BigQuery Data Owner and BigQuery Metadata Viewer roles. (I know this is overkill, but I knee-jerk added more roles when I ran into this error.)gcloud iam service-accounts keys create "liquibase-service-account-credentials.json" --iam-account "[email protected]"
liquibase generateChangeLog --url 'jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=redacted-project-id;DefaultDataset=Gabriel_Liquibase;OAuthType=0;OAuthServiceAcctEmail=liquibase@redacted-project-id.iam.gserviceaccount.com;OAuthPvtKeyPath=liquibase-service-account-credentials.json' --logLevel DEBUG --changeLogFile changelog.json --driver com.simba.googlebigquery.jdbc.Driver
Expected Behavior
A changelog is created with my table and view.
Actual Behavior
The changelog is not created.
liquibase generateChangeLog
fails with the below error (see gist for full output). If I use console.cloud.google.com to run the SQL from the error, I do get the expected view definition.The
liquibase generateChangeLog
command succeeds if I delete my view.The text was updated successfully, but these errors were encountered: