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

Hive AvroSerDe does not support circular references in Schema

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.13.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Avro allows nullable circular references but Hive AvroSerDe does not.

      Example of circular references (passing in Avro but failing in AvroSerDe):

      class AvroCycleParent {
        AvroCycleChild child;
        public AvroCycleChild getChild () {return child;}
        public void setChild (AvroCycleChild child) {this.child = child;}
      }
      
      class AvroCycleChild {
        AvroCycleParent parent;
        public AvroCycleParent getParent () {return parent;}
        public void setParent (AvroCycleParent parent) {this.parent = parent;}
      }
      

      Due to this discrepancy, Hive is unable to read Avro records having circular-references. For some third-party code with such references, it becomes very hard to directly serialize it with Avro and use in Hive.

      I have a patch for this with a unit-test and I will submit it shortly.

        Attachments

        1. HIVE-7653.1.patch
          17 kB
          Sachin Goyal
        2. HIVE-7653.2.patch
          18 kB
          Sachin Goyal
        3. HIVE-7653.3.patch
          18 kB
          Sachin Goyal
        4. HIVE-7653.4.patch
          0.8 kB
          Sachin Goyal
        5. HIVE-7653.5.patch
          18 kB
          Sachin Goyal
        6. HIVE-7653.6.patch
          17 kB
          Szehon Ho
        7. HIVE-7653.6.patch
          17 kB
          Sachin Goyal

          Issue Links

            Activity

              People

              • Assignee:
                sachingoyal Sachin Goyal
                Reporter:
                sachingoyal Sachin Goyal
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: