123
 123

Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes --

2018-01-12 Fri

03:33 work with a custom schema with Spark loading CSV file (33571 Bytes) » Developer 木匠
Here's how you can work with a custom schema, a complete demo:
Unix shell code,
$>
echo "
Slingo, iOS
Slingo, Android
" > game.csv
Scala code:
import org.apache.spark.sql.types._

val customSchema = StructType(Array(
StructField("game_id", StringType, true),
StructField("os_id", StringType, true)
))

val csv_df = spark.read.format("csv").schema(customSchema).load("game.csv")
csv_df
.show

csv_df
.orderBy(asc("game_id"), desc("os_id")).show
csv_df
.createOrReplaceTempView("game_view")
val sort_df = sql("select * from game_view order by game_id, os_id desc")
sort_df
.show

Reference,
01:35 ASSM tangle (1 Bytes) » Oracle Scratchpad
A

2018-01-11 Thu

12:40 百达翡丽968R – 复杂功能时计系列  (795 Bytes) » dba on unix

百达翡丽超级复杂功能高仿表和闻名于世的万年历高仿表都具有月相功能,月相功能用于多款女式高仿表,这款Diamond Ribbon高级珠宝高仿表内部搭载手动上弦机械机芯215 PS LU,配备小秒针表盘,镶嵌273螺旋分级大小的钻石(2.12克拉),五爪扣镶有32颗钻石(0.25克拉),表盘采用白色珍珠母贝,并刻有螺旋形装饰图案,时标是金质立体字块,表带搭配的是亮灰褐色方形鳞纹鳄鱼皮,其蓝宝石水晶透盖可清晰看到内部机芯运转,防水性能可达30米。