AWS S3 provides bulk listing API. It takes the common prefix of all input paths as a parameter and returns all the objects whose prefixes start with the common prefix in blocks of 1000.
If we will use AmazonS3Client for listing S3 files instead of using S3A, this will improve performance. To prove this idea, I adopted PrestoFileSystem instead of S3AFileSystem. When pruning partition filters, PrestoFileSystem was faster much more than S3AFileSystem.
Here is my benchmark results for the following queries:
|(#) of partitions||PrestoFileSystem(ms)||S3AFileSystem(ms)|
For the reference, I used tpc-h 1g dataset and set l_shipdate column of lineitem table to partition column.
I think there are ways to resolve this as following:
- Borrow PrestoFileSystem and related codes from Presto
- Implement necessary codes to S3TableSpace by referencing Presto