Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2061

Improve Invalid File Format Error Message

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.9.0, 1.8.2
    • 1.9.0
    • java
    • None
    • Incompatible change
    • Changed the message of the IOException thrown in case of a non avro file is passed for parsing.
    • Patch

    Description

      org.apache.avro.file.DataFileStream<D>
          try {
            vin.readFixed(magic);                         // read magic
          } catch (IOException e) {
            throw new IOException("Not a data file.", e);
          }
          if (!Arrays.equals(DataFileConstants.MAGIC, magic))
            throw new IOException("Not a data file.");
      

      Please consider improving the error message here. I just saw a MapReduce job fail with an IOException with the message "Not a data file." There was definitely data files in the input directory, however, they were not Avro files. It would have been much more helpful if it told me that.

      Attachments

        1. AVRO-2061.1.patch
          1 kB
          David Mollitor
        2. AVRO-2061.2.patch
          1 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: