通过Bash Shell创建Hive表错误

时间:2014-08-19 09:04:29

标签: hadoop hive partitioning ddl hiveql

任何人都可以告诉我为什么我在从bash shell创建partitioed表时遇到错误。

[cloudera@localhost ~]$ hive -e "create table peoplecountry (
name1 string,
name2 string,
salary int,
country string
) 
partitioned by (country string)
row format delimited
column terminated by '\n'";

Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.7.0.jar!/hive-log4j.properties
Hive history file=/tmp/cloudera/hive_job_log_0fdf7083-8ab4-499f-8048-a85f162d1357_376056456.txt
FAILED: ParseException line 8:0 missing EOF at 'column' near 'delimited'

1 个答案:

答案 0 :(得分:2)

如果您想在数据的每一行末尾添加换行符,则需要使用:

     line terminated by '\n'

代替列终止,

如果您要将行中的每列用分隔符分隔,请指定为

    fields terminated by '\n'

参考:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL