GCP Bigquery使用Java查询数据所需的依赖JAR包:

huangapple go评论92阅读模式
英文:

Dependency Jars required for querying data from GCP Bigquery using java

问题

需要用Java从GCP Bigquery查询数据所需的依赖项。

我选择了GCP的Java客户端库,而不是REST API,来查询GCP Bigquery中的数据。我添加了一个Maven pom.xml文件,以获取所需的依赖项,如下所示:

<dependencyManagement>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.google.cloud/libraries-bom -->
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>libraries-bom</artifactId>
            <version>26.17.0</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bigquery</artifactId>
        <version>2.27.1</version>
    </dependency>
</dependencies>

这将提供74个JAR文件。确实需要所有这些JAR文件吗?或者需要进行任何更正吗?

英文:

Dependency Jars required for querying data from GCP Bigquery using java.

i have to query data from gcp bigquery for that I chose java client libraries of GCP instead of REST API. I added a maven pom.xml to get the required dependencies like

      &lt;dependencyManagement&gt;
        &lt;dependencies&gt;

            &lt;!-- https://mvnrepository.com/artifact/com.google.cloud/libraries-bom --&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
                &lt;artifactId&gt;libraries-bom&lt;/artifactId&gt;
                &lt;version&gt;26.17.0&lt;/version&gt;
                &lt;type&gt;pom&lt;/type&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
            &lt;artifactId&gt;google-cloud-bigquery&lt;/artifactId&gt;
            &lt;version&gt;2.27.1&lt;/version&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;

It gave the 74 jars. truely all those jars required??
or any correction required?

答案1

得分: 1

如果在官方文档中提到的话,它必须是依赖所需的正确jar包数量,或者尝试使用BigQuery API参考文档中“开始之前”部分描述的pom内容。:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>libraries-bom</artifactId>
      <version>26.18.0</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-storage</artifactId>
  </dependency>
</dependencies>

如果您继续向下滚动,您将找到用于使用客户端库的IDE插件(这可能对您的用例有帮助):

如果您使用Visual Studio Code、IntelliJ或Eclipse,可以使用以下IDE插件将客户端库添加到您的项目中:
- Cloud Code for VS Code
- Cloud Code for IntelliJ
- Cloud Tools for Eclipse

<details>
<summary>英文:</summary>

If it is in the official documentation it must be the correct numbers of jars needed for dependencies, or try this that pom content that described in the [before you begin][1] section of BigQuery API&#39;s reference.:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.18.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
</dependency>


If you scroll down a bit more you will find IDE plugins for using client libraries(that might be helpful to your use case):

&gt;If you&#39;re using Visual Studio Code, IntelliJ, or Eclipse, you can add client libraries to your project using the following IDE plugins:
&gt;
&gt; - Cloud Code for VS Code
&gt; - Cloud Code for IntelliJ
&gt; - Cloud Tools for Eclipse


  [1]: https://cloud.google.com/bigquery/docs/reference/libraries#install

</details>



huangapple
  • 本文由 发表于 2023年7月10日 17:38:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76652504.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定