[ https://issues.apache.org/jira/browse/HIVE-5298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13780749#comment-13780749 ]
Hari Sankar Sivarama Subramaniyan commented on HIVE-5298: --------------------------------------------------------- [~xuefuz] and [~ashutoshc] : I looked at the exact piece of code and thought of doing a similar optimization mentioned here while looking at one of my jiras, HIVE-5348. It seems like 1. conf.getPathToAliases() gives the path to aliases mapping 2. conf.getPathToPartitionInfo() gives the path to partition info mapping It is clear that (1) and (2) return HashMaps of the same size, say numPaths. In the change [~xuefuz] added the below line , {code:title=MapOperator.java|borderStyle=solid} ... Set<PartitionDesc> partDescSet = new HashSet<PartitionDesc>(conf.getPathToPartitionInfo().values()); ... {code} The size of partDescSet returns the number of distinct partitions associated with the map operator. The size of the above partDescSet, say numParts, can be way less than numPaths if a partition comprises of many files. Hence the relatively less # of iterations. Hence, I would +1 since the idea behind this fix looks correct. NB: The contents of the for loop in the original code looks kind of hairy and I am rewriting the contents of the for loop as part of HIVE-5348. Thanks, Hari > AvroSerde performance problem caused by HIVE-3833 > ------------------------------------------------- > > Key: HIVE-5298 > URL: https://issues.apache.org/jira/browse/HIVE-5298 > Project: Hive > Issue Type: Improvement > Components: Query Processor > Affects Versions: 0.11.0 > Reporter: Xuefu Zhang > Assignee: Xuefu Zhang > Fix For: 0.13.0 > > Attachments: HIVE-5298.1.patch, HIVE-5298.patch > > > HIVE-3833 fixed the targeted problem and made Hive to use partition-level > metadata to initialize object inspector. In doing that, however, it goes thru > every file under the table to access the partition metadata, which is very > inefficient, especially in case of multiple files per partition. This causes > more problem for AvroSerde because AvroSerde initialization accesses schema, > which is located on file system. As a result, before hive can process any > data, it needs to access every file for a table, which can take long enough > to cause job failure because of lack of job progress. > The improvement can be made so that partition metadata is only access once > per partition. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira