Consider the following JSON file:
Now create a table in Json format using CTAS:
The output file has rows with union schema of all the fields in all the records. This creates extraneous Null fields in the output:
Note that if I change the output format to CSV or Parquet, there are no Null fields created in the output file. The expectation for a CTAS in json format is that the output should match that of the input json data.