美文网首页
Spark生成静态DataSet

Spark生成静态DataSet

作者: chenxk | 来源:发表于2019-04-19 18:11 被阅读0次
     val spark = SparkSession.builder
      .master("local[*]")
      .appName("testApp")
      .config("spark.sql.warehouse.dir", "file:///c:/tmp/spark-warehouse")
      .getOrCreate()
    
    import spark.implicits._
    
    val ds = Seq(("99227100", "42222245", "2018-04-26"),
      ("99227100", "42222245", "2018-05-01"),
      ("34011381", "42830849", "2015-12-20"),
      ("34011381", "42830849", "2016-11-27"),
      ("34011381", "42830849", "2016-12-19"),
      ("34011381", "42830849", "2017-08-05")).toDS()
    
    //.toDF("ckey", "twkey", "s_date")
    
    ds.show()
    
    

    相关文章

      网友评论

          本文标题:Spark生成静态DataSet

          本文链接:https://www.haomeiwen.com/subject/kcmcgqtx.html