[ https://issues.apache.org/jira/browse/HIVE-15546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15829006#comment-15829006 ]
Sahil Takiar commented on HIVE-15546: ------------------------------------- According to the code, dummy files are added to empty partitions so that the operator pipeline does not need to be special cased to handle such scenarios. As far as I can tell, this has been the behavior for a while: {quote} If any input path points to an empty table or partition a dummy file in the scratch dir is instead created and added to the list. This is needed to avoid special casing the operator pipeline for these cases. {quote} I originally tried to remove the dummy file logic, but that caused a bunch of test failures (ref the first Hive QA run). So I decided to make the logic multi-threaded instead. Sergey kindly pointed out some code in NullScanFileSystem and ZeroRowsInputFormat that could potentially get around this, but I was going to leave that investigation for a separate patch. Even when using the NullScanFileSystem and ZeroRowsInputFormat, a listStatus still needs to be done to see if the partition is empty or not, which can be costly on blobstores like S3. > Optimize Utilities.getInputPaths() so each listStatus of a partition is done > in parallel > ---------------------------------------------------------------------------------------- > > Key: HIVE-15546 > URL: https://issues.apache.org/jira/browse/HIVE-15546 > Project: Hive > Issue Type: Sub-task > Components: Hive > Reporter: Sahil Takiar > Assignee: Sahil Takiar > Attachments: HIVE-15546.1.patch, HIVE-15546.2.patch, > HIVE-15546.3.patch, HIVE-15546.4.patch, HIVE-15546.5.patch > > > When running on blobstores (like S3) where metadata operations (like > listStatus) are costly, Utilities.getInputPaths() can add significant > overhead when setting up the input paths for an MR / Spark / Tez job. > The method performs a listStatus on all input paths in order to check if the > path is empty. If the path is empty, a dummy file is created for the given > partition. This is all done sequentially. This can be really slow when there > are a lot of empty partitions. Even when all partitions have input data, this > can take a long time. > We should either: > (1) Just remove the logic to check if each input path is empty, and handle > any edge cases accordingly. > (2) Multi-thread the listStatus calls -- This message was sent by Atlassian JIRA (v6.3.4#6332)