Skip to content

Commit

Permalink
Test directory lister with hive paths with characters to be escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
findinpath authored and ebyhr committed Jul 27, 2023
1 parent 539d63b commit 2f513f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ public void testFileIteratorPartitionedListingNativeS3Client()
// nested-file.txt
// part=plus+sign/
// plus-file.txt
// part=percent%sign/
// percent-file.txt
// part=url%20encoded/
// url-encoded-file.txt
// part=level1|level2/
// pipe-file.txt
// parent1/
Expand All @@ -186,6 +190,8 @@ public void testFileIteratorPartitionedListingNativeS3Client()
createFile(writableBucket, format("%s/part=nested/parent/_nested-hidden-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=nested/parent/nested-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=plus+sign/plus-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=percent%%sign/percent-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=url%%20encoded/url-encoded-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=level1|level2/pipe-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=level1|level2/parent1/parent2/deeply-nested-file.txt", basePrefix));
createFile(writableBucket, format("%s/part=level1 | level2/pipe-blanks-file.txt", basePrefix));
Expand All @@ -209,6 +215,8 @@ public void testFileIteratorPartitionedListingNativeS3Client()
format("%s/part=simple/plain-file.txt", basePath),
format("%s/part=nested/parent/nested-file.txt", basePath),
format("%s/part=plus+sign/plus-file.txt", basePath),
format("%s/part=percent%%sign/percent-file.txt", basePath),
format("%s/part=url%%20encoded/url-encoded-file.txt", basePath),
format("%s/part=level1|level2/pipe-file.txt", basePath),
format("%s/part=level1|level2/parent1/parent2/deeply-nested-file.txt", basePath),
format("%s/part=level1 | level2/pipe-blanks-file.txt", basePath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ public void testFileIteratorPartitionedListing()
// nested-file.txt
// part=plus+sign/
// plus-file.txt
// part=percent%sign/
// percent-file.txt
// part=url%20encoded/
// url-encoded-file.txt
// part=level1|level2/
// pipe-file.txt
// parent1/
Expand Down Expand Up @@ -567,6 +571,12 @@ public void testFileIteratorPartitionedListing()
// create file in `part=plus+sign` non-hidden folder (which contains `+` special character)
Path plainFilePartitionPlusSign = new Path(new Path(basePath, "part=plus+sign"), "plus-file.txt");
fs.createNewFile(plainFilePartitionPlusSign);
// create file in `part=percent%sign` non-hidden folder (which contains `%` special character)
Path plainFilePartitionPercentSign = new Path(new Path(basePath, "part=percent%sign"), "percent-file.txt");
fs.createNewFile(plainFilePartitionPercentSign);
// create file in `part=url%20encoded` non-hidden folder (which contains `%` special character)
Path plainFilePartitionUrlEncoded = new Path(new Path(basePath, "part=url%20encoded"), "url-encoded-file.txt");
fs.createNewFile(plainFilePartitionUrlEncoded);
// create file in `part=level1|level2` non-hidden folder (which contains `|` special character)
Path plainFilePartitionPipeSign = new Path(new Path(basePath, "part=level1|level2"), "pipe-file.txt");
fs.createNewFile(plainFilePartitionPipeSign);
Expand Down Expand Up @@ -601,6 +611,8 @@ public void testFileIteratorPartitionedListing()
plainFilePartitionSimple,
nestedFilePartitionNested,
plainFilePartitionPlusSign,
plainFilePartitionPercentSign,
plainFilePartitionUrlEncoded,
plainFilePartitionPipeSign,
deeplyNestedFilePartitionPipeSign,
plainFilePartitionPipeSignBlanks);
Expand Down

0 comments on commit 2f513f6

Please sign in to comment.