Hi

I have staged table as

hive (revise)> desc employees_se;
OK
name                    string
salary                    float
subordinates      array<string>
deductions          map<string,float>
adr                         struct<street:string,cty:string,st:string,zip:int>

I am trying to insert the data in partitioned table employees as

hive (revise)> desc employees;
OK
name                    string
salary                    float
subordinates     array<string>
deductions         map<string,float>
address                struct<street:string,city:string,state:string,zip:int>
state                      string

# Partition Information
# col_name                        data_type                           comment

state                      string
Time taken: 0.161 seconds, Fetched: 11 row(s)

Command

FROM employees_se se
INSERT OVERWRITE TABLE employees
PARTITION(state='CA')
SELECT * WHERE se.adr.st='CA'

But I am getting an error as

FAILED: SemanticException [Error 10044]: Line 2:23 Cannot insert into target 
table because column number/types are different ''CA'': Cannot convert column 4 
from struct<street:string,cty:string,st:string,zip:int> to 
struct<street:string,city:string,state:string,zip:int>.


Any idea, as I do not see anything wrong.



Reply via email to