How to convert field have 2 types to 1 type schema in data federation

i have a collection with look like below:

{"a": "12-6-2022", "b": 1},
{"a": "", "b": 2}

when use $out to s3 with parquet format in trigger data federatoin it return schema i a group with 2 type :

a: struct<date: timestamp, string: string>

how to make data federation just create one schema type?

Hi @Dat_Le and welcome to MongoDB community forums!!

Thank you for sharing the above information. However, to understand deeper could you help me with some extra details like:

  1. Would you like to keep both the data types in the documents or would you just have one type for all the field values?
  2. Could you help me understand the query that you have followed that gave the above mentioned parquet file structure.
  3. Will it be possible to filter out only the type of the data that you wish to create the parquet file for? This would help to create one structure for same type of documents in the collection.

As per my understanding, each document in the collection is created as one parquet file and hence ideally one datatype that the field would be the part of the parquet file.

Warm Regards
Aasawari