Spark dataframes convert nested JSON to seperate columns

前端 未结 3 739
刺人心
刺人心 2021-01-27 05:58

I\'ve a stream of JSONs with following structure that gets converted to dataframe

{
  \"a\": 3936,
  \"b\": 123,
  \"c\": \"34\",
  \"attributes\": {
    \"         


        
3条回答
  •  爱一瞬间的悲伤
    2021-01-27 06:27

    Using the attributes.d notation, you can create new columns and you will have them in your DataFrame. Look at the withColumn() method in Java.

提交回复
热议问题