Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-145

InternalParquetRecordReader.close() should not throw an exception if initialization has failed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.6.0
    • parquet-mr
    • None

    Description

      InternalParquetRecordReader.close() currently throws a NullPointerException if initialize() didn't succeed and hence the "reader" remains null.

      This NPE happens with client usage idioms like this:

      AvroParquetReader reader = ...
      try {
             // read some parquet data
      } finally {
        if (reader != null) { reader.close(); }
      }
      

      I believe close() should read as follows:

      public void close() throws IOException {
          if (reader != null) {
            reader.close();
          }
        }
      

      Thoughts?

      Attachments

        Activity

          People

            whoschek Wolfgang Hoschek
            whoschek Wolfgang Hoschek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: