小编Phi*_*los的帖子

Spark sql查询与数据帧功能

使用Spark执行良好的性能.我想知道使用sql查询SQLContext是否合适,或者如果通过DataFrame函数进行查询更好df.select().

任何的想法?:)

sql performance dataframe apache-spark apache-spark-sql

16
推荐指数
3
解决办法
9026
查看次数

Spark获取嵌套json的列名

我试图通过DataFrames从嵌套的JSON中获取列名.架构如下:

root
 |-- body: struct (nullable = true)
 |    |-- Sw1: string (nullable = true)
 |    |-- Sw2: string (nullable = true)
 |    |-- Sw3: string (nullable = true)
 |    |-- Sw420: string (nullable = true)
 |-- headers: struct (nullable = true)
 |    |-- endDate: string (nullable = true)
 |    |-- file: string (nullable = true)
 |    |-- startDate: string (nullable = true)
Run Code Online (Sandbox Code Playgroud)

我可以使用df.columns()获取列名"body"和"header"但是当我尝试使用df.select("body")从正文中获取列名(例如:Sw1,Sw2,...) ).columns它总是给我身体专栏.

有什么建议吗?:)

java json nested apache-spark-sql spark-dataframe

1
推荐指数
1
解决办法
4897
查看次数