如何在cloudera quickstart vm中创建kudu表

e4yzc0pl  于 2021-06-26  发布在  Impala
关注(0)|答案(1)|浏览(458)

我一直在尝试使用cloudera快速启动vm在impala中创建一个kudu表,下面是这个示例https://kudu.apache.org/docs/quickstart.html

CREATE TABLE sfmta
PRIMARY KEY (report_time, vehicle_tag)
PARTITION BY HASH(report_time) PARTITIONS 8
STORED AS KUDU
AS SELECT
  UNIX_TIMESTAMP(report_time,  'MM/dd/yyyy HH:mm:ss') AS report_time,
  vehicle_tag,
  longitude,
  latitude,
  speed,
  heading
FROM sfmta_raw;

获取以下错误:
错误:analysisexception:不使用impalad启动标志-kudu\主\主机时,需要表属性“kudu.master\地址”。使用的虚拟机是cloudera-quickstart-vm-5.13.0-0-virtualbox。提前谢谢你的帮助

plupiseo

plupiseo1#

从文档中
如果未设置-kudu\u master\u hosts配置属性,则仍可以通过在create table语句中指定TBLPROPERTYS('kudu.master\u addresses')子句或将TBLPROPERTYS('kudu.master\u addresses')值更改为alter table语句来关联每个表的相应值。
所以您的表创建应该如下所示

CREATE TABLE sfmta
PRIMARY KEY (report_time, vehicle_tag)
PARTITION BY HASH(report_time) PARTITIONS 8
STORED AS KUDU
TBLPROPERTIES ('kudu.master_addresses'='localhost:7051') 
AS SELECT
  UNIX_TIMESTAMP(report_time,  'MM/dd/yyyy HH:mm:ss') AS report_time,
  vehicle_tag,
  longitude,
  latitude,
  speed,
  heading
FROM sfmta_raw;

7051是kudu master的默认端口。

相关问题