我正在尝试使用 HQL 在 ubuntu 中创建表

问题描述 投票:0回答:1

创建外部表格部分( p_partkey 十进制(5), p_name 字符串, p_mfgr 字符串, p_brand 字符串, p_type 字符串, p_size 十进制(2), p_container 字符串, p_retailprice 十进制(5,3) p_comment 字符串) 以“|”终止的行格式分隔字段 存储为文本文件位置 '/user/hive/part';

错误:编译语句时出错:失败:ParseException 行 10:0 不匹配的输入 'p_comment' 期望 ) 靠近 ')' 在创建表语句中(状态 = 42000,代码 = 40000)

我尝试添加一个括号,但它仍然无法正常工作。我不确定错误是什么意思。

ubuntu hadoop hive
1个回答
0
投票

使用逗号分隔所有列。你有语法错误。请使用 belwo SQL

CREATE EXTERNAL TABLE PART( p_partkey decimal(5), p_name string, p_mfgr string, p_brand string, p_type string, p_size decimal(2), p_container string, p_retailprice decimal(5,3), p_comment string )
© www.soinside.com 2019 - 2024. All rights reserved.