0

im trying to create a simple external table in hive cli and I got an error while creating a partition. I have searched on google, but I was not able to get a proper result. Can you please help

hive (sampledb)> create external table externalhive(id int,name varchar(100),age tinyint,city varchar(100),state varchar(100)) partitioned by (year string)
            > row format delimited fields terminated by '/t' stored as textfile location '/user/ah12x/external';                                      
OK
Time taken: 0.169 seconds
hive (sampledb)> show tables;
OK
externalhive

hive (sampledb)> alter table externalhive add partition (year ='2014')
            > location ('/2012');                                  
FAILED: ParseException line 2:9 extraneous input '(' expecting StringLiteral near '<EOF>'

1 Answer 1

1

There is no need for braces after location, https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterTable/PartitionLocation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.