我正在尝试这里的spark-cassandra连接器japi示例:
https://github.com/datastax/spark-cassandra-connector/blob/master/doc/7_java_api.md
maven构建失败,并出现以下错误:
SimpleApp.java:[24,9]找不到符号[ERROR]符号:类CassandraRow[ERROR]位置:类SimpleApp
我的pom.xml显示在下面
<project>
<groupId>com.example</groupId>
<artifactId>simple-project</artifactId>
<modelVersion>4.0.0</modelVersion>
<name>Simple Project</name>
<packaging>jar</packaging>
<version>1.0</version>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_2.10</artifactId>
<version>1.5.0-M3</version>
</dependency>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector-java_2.10</artifactId>
<version>1.5.0-M3</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>2.1.9</version>
</dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-mapping</artifactId>
<version>2.1.9</version>
</dependency>
</dependencies>
</project>
CassandraRow类在哪里定义?我已经浏览了包com.datatax.park.connector.japi.CassandraJavaUtil中的代码,但它没有在那里定义。该示例要求仅静态导入com.datatax.park.connector.japi,以便该示例正常工作。
任何建议都将不胜感激。
您可以让它在import com.datastax.spark.connector.CassandraRow;
中工作
我使用与您相同的依赖项(无论版本如何)
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector-java_2.10</artifactId>
<version>1.5.0-M2</version>
</dependency>