【问题标题】:Hive table creation error through Bash Shell通过 Bash Shell 创建 Hive 表错误
【发布时间】:2014-08-19 09:04:29
【问题描述】:

谁能告诉我为什么我在从 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'

【问题讨论】:

    标签: hadoop hive partitioning ddl hiveql


    【解决方案1】:

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

         line terminated by '\n'
    

    而不是由 , 终止的列

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

        fields terminated by '\n'
    

    参考:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-08
      • 1970-01-01
      • 2016-07-27
      • 1970-01-01
      • 2016-04-27
      • 2015-10-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多