GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Why there are two libraries: com.google.api.services.bigquery and com.google.cloud.bigquery? · Issue #1514 · googleapis/google-cloud-java

Why there are two libraries: com.google.api.services.bigquery and com.google.cloud.bigquery? #1514

New issue
Copy link
New issue
Copy link
Closed
Closed
Why there are two libraries: com.google.api.services.bigquery and com.google.cloud.bigquery?#1514
Copy link
Assignees
bowen0603
Labels
api: bigqueryIssues related to the BigQuery API.

Description

@bowen0603
bowen0603
opened on Jan 8, 2017
Issue body actions

I am running into this problem, and very confused. It seems there are two different libraries I can use.

One is com.google.cloud.bigquery where I see it from this source: https://cloud.google.com/bigquery/docs/reference/libraries#client-libraries-usage-java

The other one is com.google.api.services.bigquery where I see it from this source: https://github.com/googlearchive/bigquery-samples-java/blob/master/src/main/java/com/google/cloud/bigquery/samples/BigQueryJavaGettingStarted.java

The problem I am trying to solve is to set a destination table for the query. Most online QAs point me to use the second source. I followed the first source to set it up, and I am able to connect to the Bigquery now. The only problem is I cannot find a way to set the destination table.

I am super confused about these two libraries, and hope to have some explanations. Thanks!

Reacted by Pavitra Gupta

Activity

  1. garrettjonesgoogle
    added
    api: bigqueryIssues related to the BigQuery API.
    docs
    on Jan 11, 2017
  2. polleyg commented on Jan 12, 2017

    @polleyg
    polleyg
    on Jan 12, 2017
    More actions

    @bowen0603 - the first one is the new client library that Google started rolling out last month. This is the recommended one to use. Although bear in mind it's still in beta.

    Note: This client is a work-in-progress, and may occasionally make backwards-incompatible
    changes.

    The second one is the older library. You can still use this of course, but the new libraries are much nicer to use. In fact, the new one simply wraps the old one and abstracts away its nuances, and provides a much more idiomatic API.

    More info here: https://cloudplatform.googleblog.com/2016/12/announcing-new-google-cloud-client.html

    Reacted by ihommani
  3. bowen0603 commented on Jan 12, 2017

    @bowen0603
    bowen0603
    on Jan 12, 2017
    Author
    More actions

    Thanks for your reply and clarification! @polleyg It is very helpful :)

  4. bowen0603
    closed this as completedon Jan 12, 2017
  5. SampoDev commented on Jun 28, 2018

    @SampoDev
    SampoDev
    on Jun 28, 2018
    More actions

    I'm trying to execute apache beam sdk 2.4 and the libraries com.google.cloud.bigquery but thow exception

    Exception in thread main java.lang.NoSuchMethodError com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.setBatchPath(LjavalangString;)LcomgoogleapiclientgoogleapisservicesAbstractGoogleClient$Builder;
    at com.google.api.services.bigquery.Bigquery$Builder.setBatchPath(Bigquery.java3519)

    import com.google.cloud.bigquery.*;

    org.apache.beam beam-sdks-java-core org.apache.beam beam-runners-direct-java
        <dependency>
            <groupId>com.google.cloud.dataflow</groupId>
            <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
            <version>[2.4.0, 2.99)</version>
        </dependency>
    
        <!-- slf4j API frontend binding with JUL backend -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.14</version>
        </dependency>
    
       <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.14</version>
        </dependency>
    
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-bigquery</artifactId>
            <version>1.35.0</version>
        </dependency>
    
    </dependencies>
    

    the code example apache beam 2.4 using
    import com.google.api.services.bigquery.model.TableFieldSchema;
    import com.google.api.services.bigquery.model.TableRow;
    import com.google.api.services.bigquery.model.TableSchema;

    If I use the the libraries om.google.api.services.bigquery. the code example run successfully .

    What library is it using internally?

  6. JustinBeckwith
    assigned
    bowen0603
    on Feb 1, 2021
  7. bin-shi-exa commented on Jan 6, 2022

    @bin-shi-exa
    bin-shi-exa
    on Jan 6, 2022
    More actions

    This com.google.cloud.bigquery is the new API.

  8. chingor13
    added a commit that references this issue on Jan 6, 2026

    chore: Updates logging and sdk-platform-java to latest (#1514)

    1e32d31
  9. chingor13
    added a commit that references this issue on Jan 22, 2026

    feat: Introducing Tracing with OpenTelemetry API #1537 (#1576)

    5440c22
  10. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore(deps): update dependency com.google.auth:google-auth-library-oa…

    afe4ff9
  11. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency com.google.auth:google-auth-library-oa…

    a8aeb3a
  12. lqiu96
    added a commit that references this issue on Mar 20, 2026

    chore: Updates logging and sdk-platform-java to latest (#1514)

    d88f85f
  13. suztomo
    added a commit that references this issue on Mar 23, 2026

    deps: update dependency com.google.cloud:google-cloud-spanner-bom to …

    bd58057
  14. suztomo
    added a commit that references this issue on Mar 30, 2026

    deps: update dependency com.google.cloud:google-cloud-storage to v2.4…

    f11c8ec
  15. lqiu96
    added a commit that references this issue on Apr 1, 2026

    deps: update dependency com.google.cloud:google-cloud-storage to v2.4…

    275cf7e
  16. meltsufin
    added 2 commits that reference this issue on Apr 29, 2026

    chore(main): release 1.123.6-SNAPSHOT (#1514)

    3d3d609

    chore(main): release 1.123.6-SNAPSHOT (#1514)

    2e46070
  17. benjaminp
    added 2 commits that reference this issue on Jul 13, 2026

    feat: next release from main branch is 2.17.0 (googleapis#1514)

    e480dec

    chore(main): release 2.17.0 (googleapis#1516)

    9007887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @bowen0603
    bowen0603

Labels

api: bigqueryIssues related to the BigQuery API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.