24 Unstar Star 88 Fork 24

hellowzk / light-spark

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
Process2.scala 729 Bytes
Copy Edit Web IDE Raw Blame History
zhaokui authored 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)
}
}

Comment ( 0 )

Sign in for post a comment

Scala
1
https://gitee.com/hellowzk/light-spark.git
git@gitee.com:hellowzk/light-spark.git
hellowzk
light-spark
light-spark
master

Search