Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Mismatch Input Error

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
Highlighted

Re: Mismatch Input Error

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};
Don't have an account?
Coming from Hortonworks? Activate your account here