0

I am new to Hive and got an error when I tried to create a partitioned table.

here is my script:

CREATE TABLE partitionedemp(emp_no int, birth_date string, first_name string, last_name string) Partitioned By(gender string, hire_date string) stored as sequencefile;

I got an error below:

bash: syntax error near unexpected token `('

What's wrong with my script? Thank you very much.

mdivk
  • 3,545
  • 8
  • 53
  • 91

1 Answers1

0

Everything is fine , Just you have ^M characters between CREATE and TABLE keywords. To check, paste this command in vi editor and run command like this:-

$ cat -v file.txt
CREATEM-cM-^@M-^@TABLE partitionedemp(emp_no int, birth_date string, first_name string, last_name string) Partitioned By(gender string, hire_date string) stored as sequencefile;

Solution:- Straightforward one - type full create table statement on hive prompt instead of copy and paste.

sumitya
  • 2,631
  • 1
  • 19
  • 32