Created 06-08-2017 11:45 AM
Hi,
I was following the tutorial (i'm not using the sandbox) and everything was clear, until "FORMAT THE DATA WITH HIVE" I pasted the code :
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets STORED AS ORC TBLPROPERTIES("transactional"="true") FIELDS TERMINATED BY '|' LOCATION '/tmp/server-logs';
and got this error :
"org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 10:0 missing EOF at 'FIELDS' near ')'
This seems to be a common error with hive but everything I tried doesn't help. If someone has an idea it would be very usefull ! Thanks in advance
Created 06-08-2017 11:52 AM
You have missed row format delimited. Please use the below in your DDL.
FIELDS TERMINATED BY '|'
It should work. I hope it helps.
Created on 06-08-2017 01:03 PM - edited 08-17-2019 10:19 PM
Thanks for your fast answer ! I tried to add ROW format delimited but it didin't change the error
I also tried to change the order of the keywords (some say that "LOCATION" has to be before "TBLPROPERTIES") but it didn't change anything either
Created 06-08-2017 01:52 PM
Please use the below DDL.
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets STORED AS ORC ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' TBLPROPERTIES("transactional"="true")
Created 06-08-2017 01:54 PM
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets STORED AS ORC ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/server-logs' TBLPROPERTIES("transactional"="true");
Missed the location in the previous answer.
Created 06-08-2017 01:58 PM
@Bala Vignesh N V Still not, I realy don't understand where this problem come from...
Created 06-08-2017 02:15 PM
Could please share the screen shot with error after executing this code.
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets STORED AS ORC ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' TBLPROPERTIES("transactional"="true");
Created 06-08-2017 03:37 PM
@Bala Vignesh N V The error is the same as shown in my previous screenshot, here is the error stackTrace if it can help :
Created 06-09-2017 04:38 PM
There are two problems here with the DDL:
The proper definition for this table would be:
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets STORED AS ORC TBLPROPERTIES("transactional"="true");
Created 01-03-2018 05:39 PM
@Félicien Catherin The tutorial has typo...
you need to create normal table first using following sytax:
CREATE TABLE FIREWALL_LOGS( time STRING, ip STRING, country STRING, status INT ) CLUSTERED BY (time) into 25 buckets ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LOCATION '/tmp/server-logs' TBLPROPERTIES("transactional"="true");
Once the above table is created you can convert it to ORC
CREATE TABLE FIREWALL AS STORED AS ORC SELECT * FROM FIREWALL_LOGS;