The versions required for Spark and Java are as follow:
Spark Version | Scala Version | Java Version | TsFile |
---|---|---|---|
2.0-2.1 |
2.11 |
1.8 |
0.5.0 |
mvn clean scala:compile compile install
<dependency>
<groupId>cn.edu.tsinghua</groupId>
<artifactId>spark-iotdb-connector</artifactId>
<version>0.5.0</version>
</dependency>
./spark-shell --jars /home/rl/tsfile-0.5.0-SNAPSHOT.jar,/home/rl/iotdb-jdbc-0.5.0-SNAPSHOT.jar,/home/rl/spark-iotdb-connector-0.5.0.jar
val df = spark.read.format("cn.edu.tsinghua.iotdb").option("url","jdbc:tsfile://127.0.0.1:6667/").option("sql","select * from root").load
df.printSchema()
df.show()