When you run a mapping in advanced mode to read data from an Avro, flat, JSON, ORC, or Parquet file, you can use the
?
and
*
wildcard characters to specify the folder path or file name.
To use wildcard characters for the folder path or file name, select the
Allow Wildcard Characters
option in the advanced read properties of the Amazon S3 V2 data object.
? (Question mark)
The question mark character (?) allows one occurrence of a character. For example, if you enter the source file name as
a?b.txt
, the Secure Agent reads data from files with the following names:
a1b.txt
a2b.txt
aab.txt
* (Asterisk)
The asterisk mark character (*) allows zero or more than one occurrence of a character. For example, if you enter the source file name as
a*b.txt
, the Secure Agent reads data from files with the following names:
aab.txt
a1b.txt
ab.txt
abc11b.txt
You can use the asterisk (*) wildcard to fetch all the files or only the files that match the name pattern. Specify the wildcard character in the following format:
abc*.txt
abc.*
If you specify
abc*.txt
, the Secure Agent reads all the file names starting with the term
abc
and ending with the
.txt
file extension. If you specify
abc.*
, the Secure Agent reads all the file names starting with the term
abc
regardless of the extension.
Rules and guidelines for wildcard characters
Consider the following rules and guidelines when you use wildcard characters to specify the folder path or file name:
You cannot specify wildcard characters in a bucket name.
When you specify wildcard characters in a folder path and the Amazon S3 bucket does not contain folders matching the name pattern, the mapping fails.
When you specify wildcard characters in a file name and the Amazon S3 bucket does not contain files matching the name pattern, the mapping fails.
When you use wildcard characters in a folder path for a mapping in advanced mode, the Secure Agent reads data from the folders and the files that match the name pattern.