在配置单元外部表中添加分区时失败

gr8qqesn  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(467)

我试图在hivecli中创建一个简单的外部表,但在创建分区时出错。我在google上搜索过,但没有得到正确的结果。你能帮忙吗

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>'
xqnpmsa8

xqnpmsa81#

之后就不需要牙套了 location , https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#languagemanualddl-可更改/分区位置

相关问题