Repository: hive Updated Branches: refs/heads/branch-1 9e8d45111 -> 82368b64a
HIVE-11922: Better error message when ORC split generation fails (Prasanth Jayachandran reviewed by Sergey Shelukhin) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/82368b64 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/82368b64 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/82368b64 Branch: refs/heads/branch-1 Commit: 82368b64a719776353f1fc67f7bddac7cddd724b Parents: 9e8d451 Author: Prasanth Jayachandran <[email protected]> Authored: Wed Sep 23 20:00:57 2015 -0500 Committer: Prasanth Jayachandran <[email protected]> Committed: Wed Sep 23 20:00:57 2015 -0500 ---------------------------------------------------------------------- .../hadoop/hive/ql/io/orc/OrcInputFormat.java | 2 +- .../hive/ql/io/orc/TestInputOutputFormat.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/82368b64/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java index 68da26c..f078018 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java @@ -1056,7 +1056,7 @@ public class OrcInputFormat implements InputFormat<NullWritable, OrcStruct>, } catch (Exception e) { cancelFutures(pathFutures); cancelFutures(splitFutures); - throw new RuntimeException("serious problem", e); + throw new RuntimeException("ORC split generation failed with exception: " + e.getMessage(), e); } if (context.cacheStripeDetails) { http://git-wip-us.apache.org/repos/asf/hive/blob/82368b64/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java ---------------------------------------------------------------------- diff --git a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java index 5c1f8ec..b9d6c27 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java @@ -1295,6 +1295,25 @@ public class TestInputOutputFormat { assertEquals(null, serde.getSerDeStats()); } + @Test(expected = RuntimeException.class) + public void testSplitGenFailure() throws IOException { + Properties properties = new Properties(); + HiveOutputFormat<?, ?> outFormat = new OrcOutputFormat(); + org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter writer = + outFormat.getHiveRecordWriter(conf, testFilePath, MyRow.class, true, + properties, Reporter.NULL); + writer.close(true); + InputFormat<?,?> in = new OrcInputFormat(); + fs.setPermission(testFilePath, FsPermission.createImmutable((short) 0333)); + FileInputFormat.setInputPaths(conf, testFilePath.toString()); + try { + in.getSplits(conf, 1); + } catch (RuntimeException e) { + assertEquals(true, e.getMessage().contains("Permission denied")); + throw e; + } + } + static class StringRow implements Writable { String str; String str2;
