[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need to better way to create JSON If we have TableSchema and Row

Hi shivam,

It seems there is no such a function but you can write one by yourself, maybe use the com.fasterxml.jackson.databind.ObjectMapper.

Best, Hequn

On Thu, Jul 12, 2018 at 1:56 AM, Shivam Sharma <28shivamsharma@xxxxxxxxx> wrote:
Hi All,

I have TableSchema object and a Flink Row object(or list). Do we have any straightforward way to convert Row object into JSON by using Schema?

For Example:-
   - columnNames: [name, count]
   - columnTypes: [String, Integer]
Row - ("shivam", 2)
JSON - {"name": "shivam", count: 2}

Shivam Sharma
Data Engineer @ Goibibo
Indian Institute Of Information Technology, Design and Manufacturing Jabalpur
Mobile No- (+91) 8882114744