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

Creating an Avro table with a complex map-typed column leads to incorrect column type.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0
    • Fix Version/s: None
    • Component/s: Database/Schema
    • Labels:

      Description

      In the following CREATE TABLE the following map-typed column leads to the wrong type. I suspect some problem with inferring the Avro schema from the column definitions, but I am not sure.

      Reproduction:

      hive> create table t (c map<string,array<int>>) stored as avro;
      OK
      Time taken: 0.101 seconds
      hive> desc t;
      OK
      c                   	array<map<string,int>>	from deserializer   
      Time taken: 0.135 seconds, Fetched: 1 row(s)
      

      Note how the type shown in DESCRIBE is not the type originally passed in the CREATE TABLE.

      However, sometimes the DESCRIBE shows the correct output. You may also try these steps which produce a similar problem to increase the chance of hitting this issue:

      hive> create table t (c array<map<string,int>>) stored as avro;
      OK
      Time taken: 0.063 seconds
      hive> desc t;
      OK
      c                   	map<string,array<int>>	from deserializer   
      Time taken: 0.152 seconds, Fetched: 1 row(s)
      

        Attachments

          Activity

            People

            • Assignee:
              jxiang Jimmy Xiang
              Reporter:
              alex.behm Alexander Behm
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: