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

NodeRecord::isValid() treats records with no fields as invalid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.7.0
    • c++
    • None
    • c++

    Description

      Implementation of NodeRecord in NodeImpl.hh requires that a record have at least 1 field in it but this is not required as per the specification at http://avro.apache.org/docs/1.6.3/spec.html#schema_record. Either remove the condition or update the spec. This only seems to be a quirk in c++.

      NodeImpl.hh
      class AVRO_DECL NodeRecord : public NodeImplRecord
      {
      
          ...
      
          bool isValid() const {
              return (
                      (nameAttribute_.size() == 1) && 
                      (leafAttributes_.size() > 0) &&
                      (leafAttributes_.size() == leafNameAttributes_.size())
                     );
          }
      }
      

      Attachments

        1. AVRO-1065.patch
          0.4 kB
          Thiruvalluvan M. G.

        Activity

          People

            thiru_mg Thiruvalluvan M. G.
            kehli Keh-Li Sheng
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: