Dremio Union / Union all is not working as expected

Hi Everyone,

I am not able to understand, how Dremio’s UNION query works.

I have 2 data_sets

dataset-1 with columns - ID, Date, Attribute-1

dataset-2 with columns - ID, Date, Attribute-2

I have values in both datasets, for the same ID’s

select columns - ID, Date, Attribute-1, NULL as “Attribute-2” from dataset-1
UNION
select columns - ID, Date, NULL as “Attribute-1”, Attribute-2 from dataset-2

returning me Null for attribute-2 though i have values for same ID. Tried for both as String and by converting to FLOAT.

Not Sure how i will get all attribute values for the same ID.

Getting below result instead.
ID Date Attribute-1 Attribute-2
1 10-jul-2022 1.89 NULL
2 11-jul-2022 1.89 NULL
3 12-jul-2022 1.89 NULL
4 13-jul-2022 1.89 NULL

@s.ranjan0404 Can you send us the job profile?

@balaji.ramaswamy - Thanks for your reply. I am able to resolve this issue. As we have ~100 columns in my union query there was a order mismatch of columns which is working fine now.