CodePudding
Home
front end
Back-end
Net
Software design
Enterprise
Blockchain
Mobile
Software engineering
database
OS
other
Home
>
other
> How to put the json format DataSet<String> Convert the Map format DataSet<Map>
How to put the json format DataSet<String> Convert the Map format DataSet<Map>
Time:09-18
Using StructuredStream implementation flow data was obtained from the kafka, each data are json format String, get DataSet
Now to save the data in elasticsearch, use DataSet
MapSet=stringSet. The map (the line - & gt; JsonToMap (line), Encoder. Bean (Map. Class)) complains this way, is there any other better way?
CodePudding user response:
Use fastjson parseObject directly, and then get a map, not beautiful
CodePudding user response:
Agree with upstairs, you can after receiving the data, when for the map function operation take out data conversion can also directly
Page link:
https//www.codepudding.com/other/8480.html
Prev:
Entry-level problem elasticsearch is operated in the spark, can use elasticsearch Java client
Next:
Docker container tip Permission denied, how do you solve this Permission problems?
Tags:
The Spark
Related
Links:
CodePudding