Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-17223

HCatReader throws exception attempting to read a view

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.1
    • None
    • HCatalog
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nbamford Nathan Bamford
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: