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

Struct datatype should not use field names for type equivalence.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None
    • Environment:

      Mac OS X (10.6.2) Java SE 6 ( 1.6.0_17)

      Description

      The field names for Struct types are currently being matched for testing type equivalence. This is readily seen by running the following example:

      hive> create table source ( foo struct < x : string > );
      OK
      Time taken: 3.094 seconds
      
      hive> load data local inpath '/path/to/sample/data.txt' overwrite into table source;
      Copying data from file:/path/to/sample/data.txt
      Loading data to table source
      OK
      Time taken: 0.593 seconds
      
      hive> create table sink ( bar struct < y : string >);
      OK
      Time taken: 0.11 seconds
      
      hive> insert overwrite table sink select foo from source;
      FAILED: Error in semantic analysis: line 1:23 Cannot insert into target table 
      because column number/types are different sink: Cannot convert column 0 
      from struct<x:string> to struct<y:string>.
      
      

      Since both soruce.foo and sink.bar are similar in definition with only field names being different, data movement between these two should be allowed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aprabhakar Arvind Prabhakar
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: