天天看點

spark-shell讀取外部資料源

啟動

  • spark-shell –jars a.jar,b.jar

    這種是local模式

    多個jar包之間用逗号分隔,不能有空格

  • spark-shell –jars a.jar,b.jar –master spark://ip:7077

使用方式

import cn.edu.thu.tsfile._
spark.read.tsfile("path")           
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()           

繼續閱讀