1

I am trying to create a table in hive using following query:

create table customers(Cust_ID INT, Cust_Name STRING, Dealer_ID INT, Country STRING, State STRING, City STRING, ZipCode INT)
    row format delimited
    fields terminated by ';'
    stored as textfile;

but i'm getting the following error:

FAILED: Parse Error: line 0:-1 mismatched input '<EOF>' expecting StringLiteral in table row format's field separator

i have created previously transactions table with same syntax and it had worked out just fine..but somehow i think m making some syntatical error. plz help.

Sachin Janani
  • 1,310
  • 1
  • 17
  • 33
Mrudula
  • 11
  • 1
  • 3

2 Answers2

0

Try escaping ';' by adding '\' os your query will look as follow:

create table customers(Cust_ID INT, Cust_Name STRING, Dealer_ID INT, Country STRING, State STRING, City STRING, ZipCode INT)
    row format delimited
    fields terminated by '\;'
    stored as textfile;
Sachin Janani
  • 1,310
  • 1
  • 17
  • 33
0

Try using the OCT \073 instead of ';' Example:

row format delimited fields terminated by '\073'
Filippo Loddo
  • 966
  • 9
  • 14