1 Star 0 Fork 72

Kenian Shi / light-spark

forked from hellowzk / light-spark 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Process2.scala 729 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhaokui 提交于 2020-08-06 17:33 . first commit
package com.hellowzk.light.spark.stages
import com.hellowzk.light.spark.beans.transform.CustomTransformConfig
import com.hellowzk.light.spark.stages.custom.CustomBaseTransform
import org.apache.spark.sql.SparkSession
/**
* <p>
* 日期: 2020/7/6
* <p>
* 时间: 17:43
* <p>
* 星期: 星期一
* <p>
* 描述:
* <p>
* 作者: zhaokui
**/
class Process2 extends CustomBaseTransform {
override def doProcess(bean: CustomTransformConfig)(implicit ss: SparkSession): Unit = {
val rdd = getRDDByTable("table2").map(_.toSeq.map(_.toString)).map(cols => (cols(0), cols(1), cols(2), "ttt"))
import ss.implicits._
rdd.toDF("count", "gend", "date", "added").createOrReplaceTempView(bean.getName)
}
}
Scala
1
https://gitee.com/kshi/light-spark.git
git@gitee.com:kshi/light-spark.git
kshi
light-spark
light-spark
master

搜索帮助