Nathan Bamford created HIVE-17223: ------------------------------------- Summary: HCatReader throws exception attempting to read a view Key: HIVE-17223 URL: https://issues.apache.org/jira/browse/HIVE-17223 Project: Hive Issue Type: Bug Components: HCatalog Affects Versions: 1.2.1 Reporter: Nathan Bamford
When HCatReader.prepareRead is called with a ReadEntity built with a view, a null exception is thrown: HCatOutputFormat not initialized, setOutput has to be called. Cause : java.io.IOException: java.lang.NullPointerException org.apache.hive.hcatalog.data.transfer.impl.HCatInputFormatReader.prepareRead(HCatInputFormatReader.java:73) net.redpoint.hiveclient.DMHCatSplitReader.getSplitInfo(DMHCatSplitReader.java:127) Caused by: java.io.IOException: java.lang.NullPointerException org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:97) org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:61) org.apache.hive.hcatalog.data.transfer.impl.HCatInputFormatReader.prepareRead(HCatInputFormatReader.java:65) net.redpoint.hiveclient.DMHCatSplitReader.getSplitInfo(DMHCatSplitReader.java:127) Caused by: java.lang.NullPointerException java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:274) org.apache.hadoop.hive.common.JavaUtils.loadClass(JavaUtils.java:78) org.apache.hadoop.hive.common.JavaUtils.loadClass(JavaUtils.java:74) org.apache.hive.hcatalog.mapreduce.FosterStorageHandler.<init>(FosterStorageHandler.java:68) org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(HCatUtil.java:404) org.apache.hive.hcatalog.common.HCatUtil.getStorageHandler(HCatUtil.java:367) org.apache.hive.hcatalog.mapreduce.InitializeInput.extractPartInfo(InitializeInput.java:158) org.apache.hive.hcatalog.mapreduce.InitializeInput.getInputJobInfo(InitializeInput.java:137) org.apache.hive.hcatalog.mapreduce.InitializeInput.setInput(InitializeInput.java:86) org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:95) org.apache.hive.hcatalog.mapreduce.HCatInputFormat.setInput(HCatInputFormat.java:61) org.apache.hive.hcatalog.data.transfer.impl.HCatInputFormatReader.prepareRead(HCatInputFormatReader.java:65) Digging into the code a little bit, I discovered that the StorageDescriptor associated with the view has its serializationLib set to null, and this eventually causes the null error when calling HCatUtil.getStorageHandler. -- This message was sent by Atlassian JIRA (v6.4.14#64029)