Use Partition Attribute Types
Note
When specifying the
path
:
Specify the data type for the partition attribute.
Ensure that the partition attribute type matches the data type to parse.
Use the delimiter specified in
delimiter
.
When specifying attributes of the same type, do any of the following:
Add a constant separator between the attributes.
Use regular expressions to describe the search pattern. To learn more, see Unsupported Parsing Functions.
Supported Partition Attribute Types
The following table lists the supported data types for partition
attributes, filename, and
~databases.[n].collections.[n].dataSources.[n].path
example for
each data type:
Key | Data Type | Example | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
string | Parses the filename as a string. | filename: path: In the preceding example, Data Federation interprets To learn more, see Parsing Null Values from Filenames. | ||||||||||||||||||||||||||||||||||||
int | Parses the filename as an integer. | filename: path: In the preceding example, Data Federation interprets To learn more, see Parsing Padded Numbers from Filenames. | ||||||||||||||||||||||||||||||||||||
isodate | Parses the filename in RFC 3339
format as an ISO-8601 format date. | filename:
In the preceding example, for the first path, Data Federation interprets
If you don't specify a specific format as shown in the first ISODate attribute path example above, Atlas Data Federation defaults to partitions with the following date formats:
If you wish to specify a format, which improves performance, you
must use special values to indicate the exact position of the
attributes in the date such as day ( | ||||||||||||||||||||||||||||||||||||
epoch_secs | Parses the filename as a Unix timestamp in seconds. | filename: path: In the preceding example, Data Federation interprets To learn more, see Parsing Padded Numbers from Filenames. | ||||||||||||||||||||||||||||||||||||
epoch_millis | Parses the filename as a Unix timestamp in milliseconds. | filename: path: In the preceding example, Data Federation interprets To learn more, see Parsing Padded Numbers from Filenames. | ||||||||||||||||||||||||||||||||||||
objectid | Parses the filename as an
ObjectId. | filename: path: In the preceding example, Data Federation interprets | ||||||||||||||||||||||||||||||||||||
uuid | Parses the filename as a UUID of binary subtype
4. | filename: path: In the preceding example, Data Federation interprets |
Note
Atlas Data Federation supports the Package Syntax for regular expressions in the path to the filename.
Supported Conversions
Atlas Data Federation converts the partition attributes to BSON types when parsing the
path
to the filename. Later writes of data to cloud storage must use the BSON types
after converting them to string. The following table shows:
The partition attribute types and the BSON types to which Data Federation converts them.
The BSON data type to convert to a string for later writes to cloud storage.
Partition Attribute Type | Parsed BSON Type | Source BSON Type |
---|---|---|
string |
|
|
int |
|
|
isodate |
|
|
objectid |
|
|
uuid |
|
|