【发布时间】:2020-05-13 09:30:25
【问题描述】:
我想从另一个配置单元表(放置在一个列事件数据中)的 json 数据创建一个平面配置单元表。下面是json数据结构。我已经使用稍后的视图创建了配置单元表,但现在我想使用带有一些 UDF 的 pyspark 来创建配置单元表。
'{"callId":"0000000","journey":{"channel":{"out":"sssss@icloud.com","outbound":"EMAIL"}},"application":{"componentId":"23456","name":"dfgt-ghy-svc","applicationReferenceId":"SRFC98756RD"},"servicingDetail":{"offerAttributes":{"id":"ADLC0110000"},"offerCommunicationAttributes":{"id":"CFRGTV10098","status":"SUCCESS"}},"customerInfo":{"calledInAccount":"ERFCVDG9801"},"correlationId":"9845-sd76-sdfr87","fulfiller":{"id":"DEFC1009","category":"TST","entity":"colleague"},"platform":{"name":"v-generation","id":"37664859"}}'
我只需要提取 4 列,它们是 callId、correlationId、servicingDetail -offerAttributes-id、fulfiller-id
请帮我做同样的事情。
【问题讨论】:
标签: json pyspark hive apache-spark-sql hiveql