hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mithun Radhakrishnan (JIRA)" <>
Subject [jira] [Commented] (HIVE-13509) HCatalog getSplits should ignore the partition with invalid path
Date Tue, 26 Apr 2016 17:00:16 GMT


Mithun Radhakrishnan commented on HIVE-13509:

Reviewing your patch now. On the face of it, it looks good. Looking at it a little more closely...

A couple of observations:
# {{hcat.input.ignore.invalid.path}} is well-named, and would make sense to anyone who'd want
to override the default. (I thought we'd go with {{hcat.input.allow.invalid.path=true}}, but
your version is better.
# Consider replacing {{(pathString == null || pathString.trim().isEmpty())}} with {{StringUtils.isBlank(pathString)}}.
# Nitpick: Consider replacing the loop at {{}} with Google
Guava's {{Iterators.filter()}}. Then, depending on whether {{ignoreInvalidPath}} is set, the
erstwhile loop at Line#329 will either loop on {{paths}} or on {{filteredPaths}}. This will
be more readable.

> HCatalog getSplits should ignore the partition with invalid path
> ----------------------------------------------------------------
>                 Key: HIVE-13509
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>          Components: HCatalog
>            Reporter: Chaoyu Tang
>            Assignee: Chaoyu Tang
>         Attachments: HIVE-13509.1.patch, HIVE-13509.patch
> It is quite common that there is the discrepancy between partition directory and its
HMS metadata, simply because the directory could be added/deleted externally using hdfs shell
command. Technically it should be fixed by MSCK and alter table .. add/drop command etc, but
sometimes it might not be practical especially in a multi-tenant env. This discrepancy does
not cause any problem to Hive, Hive returns no rows for a partition with an invalid (e.g.
non-existing) path, but it fails the Pig load with HCatLoader, because the HCatBaseInputFormat
getSplits throws an error when getting a split for a non-existing path. The error message
might looks like:
> {code}
> Caused by: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist:
> 	at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(
> 	at org.apache.hadoop.mapred.FileInputFormat.listStatus(
> 	at org.apache.hadoop.mapred.FileInputFormat.getSplits(
> 	at org.apache.hive.hcatalog.mapreduce.HCatBaseInputFormat.getSplits(
> 	at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigInputFormat.getSplits(
> {code}

This message was sent by Atlassian JIRA

View raw message