gpt4 book ai didi

hadoop - 通过 Bash Shell 创建 Hive 表错误

转载 作者:可可西里 更新时间:2023-11-01 16:32:13 26 4
gpt4 key购买 nike

谁能告诉我为什么在从 bash shell 创建分区表时出现错误。

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

最佳答案

如果您的意思是在每行数据的末尾换行,那么您需要使用:

     line terminated by '\n'

而不是以 , 结尾的列

如果您的意思是行中的每一列都由定界符分隔,则指定为

    fields terminated by '\n'

引用:

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

关于hadoop - 通过 Bash Shell 创建 Hive 表错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25379473/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com