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 @@ private boolean isStripeSatisfyPredicate(StripeStatistics stripeStatistics, } 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) { 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 void testEmptyFile() throws Exception { 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;