Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Mismatch Input Error

Explorer

Hello Community,

I have created the following Hive script, however, I keep on getting the error message:

FAILED: ParseException line 3:10 mismatched input 'INTO' expecting INPATH near 'DATA' in load statement
18/01/27 11:49:50 [main]: ERROR ql.Driver: FAILED: ParseException line 3:10 mismatched input 'INTO' expecting INPATH near 'DATA' in load statement
org.apache.hadoop.hive.ql.parse.ParseException: line 3:10 mismatched input 'INTO' expecting INPATH near 'DATA' in load statement

Can someone please let me know where I'm going wrong.

set hive.exec.dynamic.partition.mode=nonstrict;
DROP TABLE IF EXISTS datafactory7;
CREATE EXTERNAL TABLE datafactory7
(
 anonid INT,
 eprofileclass INT,
 fueltypes STRING,
 acorn_category INT,
 acorn_group STRING,
 acorn_type INT,
 nuts4 STRING,
 lacode STRING,
 nuts1 STRING,
 gspgroup STRING,
 ldz STRING,
 gas_elec STRING,
 gas_tout STRING
)
ROW FORMAT DELIMITED
 FIELDS TERMINATED BY ','
STORED AS TEXTFILE
TBLPROPERTIES ("skip.header.line.count" = "1");
LOAD DATA INTO '${hiveconf:inputtable}' 
select * from datafactory7 limit 14
STORED AS TEXTFILE 
LOCATION '${hiveconf:partitionedtable}';

Thanks

Carlton

1 REPLY 1

Take a look at this guide:

https://cwiki.apache.org/confluence/display/hive/languagemanual+dml#LanguageManualDML-Loadingfilesin...

You should either try

INSERT INTO TABLE '${hiveconf:inputtable}' SELECT * FROM datafactory7 limit 14;

or

LOAD DATA INPATH '<HDFS PATH WHERE FILES LOCATED>' INTO TABLE ${hiveconf:inputtable};
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.