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

BigQueryOption.Builder ignores host parameter (regression versus 2.35.0) #3125

Closed
JiriOndrusek opened this issue Feb 8, 2024 · 3 comments
Closed
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.

Comments

@JiriOndrusek
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version: linux (not related)
  3. Java version: Temurin-17.0.9+9 (not related)
  4. version(s): google-cloud-bigquerry:2.37.0 (worked in 2.35.0)

Steps to reproduce

Create a GoogleBigQueryConnectionFactory via builder and use 'setHost'

                BigQueryOptions.Builder builder = BigQueryOptions.newBuilder().setProjectId(projectId);

                if (host != null) {
                    builder.setHost(host)
                            .setLocation(host);
                }

...

                return builder.build()
                        .getService();

If client created by such service is used for execution of request. The host parameter is ignored.

Please look into the recent change b2814a2#diff-a5b2825562e3ffa23e5250337fa30f136c7ee6b3409b66f0da4fc78c8b9414d6L108

As you can see, the host parameter is ignored and method ServiceOptions.getResolvedApiaryHost used instead. This method does ignore host parameter as well.

Code example

I found the error during testing camel-quarkus from the camel-main branch. All of the tests are failing because of this issue - https://github.com/apache/camel-quarkus/blob/camel-main/integration-tests/google-bigquery/src/test/java/org/apache/camel/quarkus/component/google/bigquery/it/GoogleBigqueryTest.java

Stack trace

Any relevant stacktrace here.

External references such as API reference guides

  • ?

Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

@JiriOndrusek
Copy link
Author

I can not asses whether this is a bug or a feature. In case this is not a bug, may I ask for help with a workaround for the tests in camel-quarkus? Is there a way of constructing client via GoogleBigQueryConnectionFactory with testing hostname?

@PhongChuong
Copy link
Contributor

PhongChuong commented Feb 9, 2024

Hi,
Thanks for reporting this. This is indeed a bug. We're working a a fix. For now, can you downgrade to 2.35.0.

lqiu96 added a commit to googleapis/sdk-platform-java that referenced this issue Feb 9, 2024
Bug: googleapis/java-bigquery#3125 (Removing
`Fixes:` as I don't want to close the ticket until BigQuery is able to
pull in a new version of shared-deps).

Following guidance in doc for Apiary (ping me internally for link).

If the user configures the host to be the `DEFAULT_HOST` (a non-valid
endpoint for any service using java-core), then it should construct a
valid service endpoint back using the universe domain.
@PhongChuong
Copy link
Contributor

Release v2.37.2 includes the fix to this issue. Please open a new bug if the issue persists.

ddixit14 pushed a commit to googleapis/sdk-platform-java that referenced this issue Feb 15, 2024
Bug: googleapis/java-bigquery#3125 (Removing
`Fixes:` as I don't want to close the ticket until BigQuery is able to
pull in a new version of shared-deps).

Following guidance in doc for Apiary (ping me internally for link).

If the user configures the host to be the `DEFAULT_HOST` (a non-valid
endpoint for any service using java-core), then it should construct a
valid service endpoint back using the universe domain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.
Projects
None yet
Development

No branches or pull requests

2 participants