I have 2 table ‘salaries_staging’ populated with data and stored in textfile format with below schema.
Now i have created another table sal_orc which have consists of some of the columns of ‘salaries_staging’ table.
Aim is: To insert data from ‘salaries_staging’ table into ‘sal_orc’ based on some where condition.
It is giving me below error.please help to solve this.
create table salaries_staging(
row format delimited fields terminated by ','
stored as textfile;
load data local inpath ‘/root/sf-salaries-2011-2013.csv’ into table salaries_staging;
CREATE TABLE sal_orc(
stored as ORC;
insert into table sal_orc select JobTitle,BasePay,OvertimePay,OtherPay,Benefits,TotalPay from salaries_staging where totalpay <= 18500.19;
FAILED: SemanticException [Error 10044]: Line 1:18 Cannot insert into target table because column number/types are different ‘sal_orc’: Table insclause-0 has 7 columns, but query has 6 columns.
Thanks in advance.