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
  • Related