How to standardize the output of USQL to have data for all the columns when converted from JSON
We have a requirement to standardize the output of USQL. The USQL reads the JSON (source file) data and convert it to csv format. The problem is that the number of columns we have for each row in the csv is not the same because of missing data in the JSON. Sometimes the result set of USQL have a row in csv with "N" columns, another row is with "N+1" columns (cells). We would like to standardize the output, having the same number columns in csv for all the rows. How do we achieve this? We don't have any control over source file data, we would need to do the standardization while processing. Has anyone faced similar challenges and found a solution? Thanks for your help!
Input details :
{"map": {"key1": 100, "key2": 101, "key3": 102}, "id": 2, "time": 1540300241230}
{"map": {"key1": 200, "key2": 201, "key3": 202 "key4": 203}, "id": 2, "time": 1540320246930}
{"map": {"key1": 300, "key3": 301, "key4": 303}, "id": 2, "time": 1540350246930}
Once the above JSON is converted to CSV based on some calculation
Output as is which is not correct
key1, key2, key3, key4
100, 101, 102
200, 201, 202, 203
300, 301, 303
Value "301" is not associated with the key2
Output expected - # is the default for missing column values
key1, key2, key3, key4
100, 101, 102, #
200, 201, 202, 203
300, #, 301, 303
Later all the headings ( key1, key2..) will be replaced with actual header names ( Pressure, Velocity...etc)