package com.njbdqn.mydataset
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
/**
* 使用dataSet完成零售商店指标统计
* 1、使用RDD装在零售商店业务数据
* customers.csv、orders.csv、order_items.csv、products.csv
* 2、定义样例类
* 将RDD转成DataSet
*/
object MyThirdSpark1 {
//参照csv表格写样例类
case class Customers(userid:String,fname:String,lname:String,tel:String,email:String,addr:String,city:String,state:String,zip:String)
case class Orders(ordid:String,orddate:String,userid:String,ordstatus:String)
case class OrderItems(id:String,ordid:String,proid:String,buynum:String,countPrice:String,pr
Spark SQL API——使用Case Class创建Dataset
最新推荐文章于 2024-05-01 03:33:34 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)