You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Sachin Goyal (JIRA)" <ji...@apache.org> on 2014/08/08 01:01:13 UTC

[jira] [Updated] (HIVE-7653) Hive AvroSerDe does not support circular references in Schema

     [ https://issues.apache.org/jira/browse/HIVE-7653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sachin Goyal updated HIVE-7653:
-------------------------------

    Affects Version/s: 0.13.1
               Status: Patch Available  (was: Open)

HIVE-7653.1.patch uses a map to store schemas for which Type has been processed already.
If they have been processed already, it uses the processed result, thus preventing an infinite loop.

To see the infinite loop, comment following line in SchemaToTypeInfo.java:
{code}
schemaSeenMap.put(schema, primitiveTypeToTypeInfo.get(Schema.Type.NULL));
{code}



> Hive AvroSerDe does not support circular references in Schema
> -------------------------------------------------------------
>
>                 Key: HIVE-7653
>                 URL: https://issues.apache.org/jira/browse/HIVE-7653
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.13.1
>            Reporter: Sachin Goyal
>         Attachments: HIVE-7653.1.patch
>
>
> Avro allows nullable circular references but Hive AvroSerDe does not.
> Example of circular references (passing in Avro but failing in AvroSerDe):
> {code}
> 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;}
> }
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)