我正在尝试将数据从 Google BigQuery 加载到在 Google Dataproc 上运行的 Spark(我正在使用 Java)。我尝试按照此处的说明进行操作:https ://cloud.google.com/dataproc/docs/tutorials/bigquery-connector-spark-example
我收到错误:“ ClassNotFoundException: Failed to find data source: bigquery
。”
我的 pom.xml 如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.virtualpairprogrammers</groupId>
<artifactId>learningSpark</artifactId>
<version>0.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud.spark</groupId>
<artifactId>spark-bigquery_2.11</artifactId>
<version>0.9.1-beta</version>
<classifier>shaded</classifier>
</dependency>
</dependencies>
将依赖项添加到我的 pom.xml 后,它会下载大量内容来构建 .jar,所以我认为我应该拥有正确的依赖项?然而,Eclipse 还警告我“从未使用过 import com.google.cloud.spark.bigquery”。
MM们
牧羊人nacy
慕森王
相关分类