Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Mismatch Input Error

avatar
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

avatar
Contributor

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};