I have a JSON file in S3 of the format:
{
"A":"a",
"C":{"C1":"c1","C2":"c2"},
"E":"e"
}
And when I query like
select S3Object.A,S3Object.C1,S3Object.C2,S3Object.E from S3Object
I get below in CSV output:
A,C1,C2,E
a,e
I understand that the correct query is below:
select S3Object.A,S3Object.C.C1,S3Object.C.C2,S3Object.E from S3Object
and that will give me the output
A,C.C1,C.C2,E
a,c1,c2,e
But by querying a non-existant column, why does value e get shifted to show the value below C1 column instead of E column?
I could not find any documentation in Amazon AWS about the behavior if I query a non-existant column.
select S3Object.A,S3Object.D,S3Object.E from S3Object
The output being:
A,D,E
a,e
Is there any way to??
1. Hide D from column header when it doesn't exist in JSON source??
A,E
a,e
2. Or, leave the field as empty corresponding to the column header D??
A,D,E
a,,e