启动
spark-shell –jars a.jar,b.jar
这种是local模式
多个jar包之间用逗号分隔,不能有空格spark-shell –jars a.jar,b.jar –master spark://ip:7077
通过spark-shell连接spark集群
使用方式
spark.read.xxx(“”)这种用法需要先import
import cn.edu.thu.tsfile._
spark.read.tsfile("path")
其他方法则不需要import,可以直接用
spark.read.format("cn.edu.thu.tsfile").load("hdfs://ip:9000/file1")
sql("create temprory view tsfile using cn.edu.thu.tsfile options (path \"hdfs://ip:port/file1\")")
sql("select * from tsfile").count()