Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -643,15 +643,11 @@ jobs:
env:
BIGQUERY_CREDENTIALS_KEY: ${{ secrets.BIGQUERY_CREDENTIALS_KEY }}
GCP_STORAGE_BUCKET: ${{ vars.GCP_STORAGE_BUCKET }}
BIGQUERY_TESTING_PROJECT_ID: ${{ vars.BIGQUERY_TESTING_PROJECT_ID }}
BIGQUERY_TESTING_PARENT_PROJECT_ID: ${{ vars.BIGQUERY_TESTING_PARENT_PROJECT_ID }}
if: matrix.modules == 'plugin/trino-bigquery' && !contains(matrix.profile, 'cloud-tests-2') && (env.CI_SKIP_SECRETS_PRESENCE_CHECKS != '' || env.BIGQUERY_CREDENTIALS_KEY != '')
run: |
$MAVEN test ${MAVEN_TEST} -pl :trino-bigquery -Pcloud-tests-1 \
-Dbigquery.credentials-key="${BIGQUERY_CREDENTIALS_KEY}" \
-Dtesting.gcp-storage-bucket="${GCP_STORAGE_BUCKET}" \
-Dtesting.bigquery-project-id="${BIGQUERY_TESTING_PROJECT_ID}" \
-Dtesting.bigquery-parent-project-id="${BIGQUERY_TESTING_PARENT_PROJECT_ID}"
-Dtesting.gcp-storage-bucket="${GCP_STORAGE_BUCKET}"
- name: Cloud BigQuery Smoke Tests
id: tests-bq-smoke
env:
Expand Down
2 changes: 0 additions & 2 deletions plugin/trino-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@
<exclude>**/TestBigQueryCaseInsensitiveMappingWithCache.java</exclude>
<exclude>**/TestBigQuery*FailureRecoveryTest.java</exclude>
<exclude>**/TestBigQueryWithProxyTest.java</exclude>
<exclude>**/TestBigQueryParentProjectId.java</exclude>
</excludes>
</configuration>
</plugin>
Expand All @@ -559,7 +558,6 @@
<configuration>
<includes>
<include>**/TestBigQueryAvroConnectorTest.java</include>
<include>**/TestBigQueryParentProjectId.java</include>
</includes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public TableInfo getCachedTable(Duration viewExpiration, TableInfo remoteTableId
*/
public String getParentProjectId()
{
return Optional.ofNullable(bigQuery.getOptions().getQuotaProjectId()).orElse(bigQuery.getOptions().getProjectId());
return bigQuery.getOptions().getProjectId();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ public class CredentialsOptionsConfigurer
implements BigQueryOptionsConfigurer
{
private final BigQueryCredentialsSupplier credentialsSupplier;
private final Optional<String> configProjectId;
private final Optional<String> configParentProjectId;

@Inject
public CredentialsOptionsConfigurer(BigQueryConfig bigQueryConfig, BigQueryCredentialsSupplier credentialsSupplier)
{
this.configProjectId = bigQueryConfig.getProjectId();
this.configParentProjectId = bigQueryConfig.getParentProjectId();
this.credentialsSupplier = requireNonNull(credentialsSupplier, "credentialsSupplier is null");
}
Expand All @@ -46,11 +44,9 @@ public CredentialsOptionsConfigurer(BigQueryConfig bigQueryConfig, BigQueryCrede
public BigQueryOptions.Builder configure(BigQueryOptions.Builder builder, ConnectorSession session)
{
Optional<Credentials> credentials = credentialsSupplier.getCredentials(session);
String projectId = resolveProjectId(configProjectId, credentials);
String parentProjectId = resolveProjectId(configParentProjectId, credentials);
credentials.ifPresent(builder::setCredentials);
builder.setProjectId(projectId);
// Quota project id is different name for parent project id, both indicates project used for quota and billing purposes.
configParentProjectId.ifPresent(builder::setQuotaProjectId);
builder.setProjectId(parentProjectId);
return builder;
}

Expand Down

This file was deleted.