Hive
  1. Hive
  2. HIVE-4032

Inserting data into Hive table from a query, when the query is a partitioned table and select * ,will generate a SemanticException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None
    • Environment:

      Apache Hadoop 0.19.1 + Apache Hive 0.10.0

      Description

      Inserting data into Hive table from a query , when the query is : select * from a_partitioned_table, will throw a SemanticException .
      It seems that "*" contains the virtual partition columns.

      drop table if exists zr_test;
      create table if not exists zr_test (key string, value string) partitioned by (dt string);

      drop table if exists zr_test_1;
      create table if not exists zr_test_1 (key string, value string) partitioned by (dt string);

      --Query One
      explain
      insert into table zr_test partition (dt='20130217') select key, value from zr_test_1 where dt='20130217';

      --Query Two
      explain
      insert into table zr_test partition (dt='20130217') select * from zr_test_1 where dt='20130217';

      Ouery One works well, bug Query Two failed with the following information:
      FAILED: SemanticException [Error 10044]: Line 2:18 Cannot insert into target table because column number/types are different ''20130217'': Table insclause-0 has 2 columns, but query has 3 columns.

      p.s:
      Query Two works well on Apache Hadoop 0.20.1 + Hive 0.10.0

        Activity

        Show
        caofangkun added a comment - https://reviews.apache.org/r/10234/
        Hide
        caofangkun added a comment -

        Not BUG

        Show
        caofangkun added a comment - Not BUG

          People

          • Assignee:
            caofangkun
            Reporter:
            caofangkun
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development