Urmas Tamassy created HIVE-22660:
------------------------------------

             Summary: HDFS path is encoded twice when inserting to a 
partitioned table using dynamic partitions.
                 Key: HIVE-22660
                 URL: https://issues.apache.org/jira/browse/HIVE-22660
             Project: Hive
          Issue Type: Bug
          Components: HiveServer2, Query Planning
    Affects Versions: 2.1.1
            Reporter: Urmas Tamassy
         Attachments: details.txt

Tested on CDH 5.16.1 (Hive 1.1) and CDH 6.3 (Hive 2.2.1).

When file merging is enabled, ie. hive.merge.mapfiles or hive.merge.mapredfiles 
is true (or in case of spark hive.merge.sparkfiles), under specific conditions 
(see: 
[ConditionalResolverMergeFiles|https://github.com/apache/hive/blob/e06bf8d273f3e391b269da4d3217f12bbc165cfc/ql/src/java/org/apache/hadoop/hive/ql/plan/ConditionalResolverMergeFiles.java#L207],
 option 3.) on insert commands to partitioned tables, if Hive merges some 
partition files in a second job and moves the ones that do not need to be 
merged from the first jobs result, then the ones that can be moved are moved 
twice. This seems to cause file paths to be encoded twice as well
([FileUtils#escapePathName()|https://github.com/apache/hive/blob/f37c5de6c32b9395d1b34fa3c02ed06d1bfbf6eb/common/src/java/org/apache/hadoop/hive/common/FileUtils.java#L271])
 . For example, this can cause issues with partition values such as 'A:B' and 
'C:D' to be encoded as 'A%3AB' for one partition path correctly and as 
'C%253AD' for the other partition incorrectly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to