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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: parquet-mr
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: