Apache Drill 和 Apache Kudu - 无法使用 Apache Drill 为通过 Apache Impala 在 Kudu 中创建的表运行"从<某些表>中选择 *



我能够通过ApacheDrill连接到Kudu,并且能够很好地列出表。但是当我必须从表中提取数据时;黑斑羚::默认。客户"下面,我尝试了不同的选项,但没有一个对我有效。

Kudu中的表是通过Impala Shell作为外部表创建的。

  1. 到Kudu的初始连接和列出对象
ubuntu@ubuntu-VirtualBox:~/Downloads/apache-drill-1.19.0/bin$ sudo ./drill-embedded
Apache Drill 1.19.0
"A Drill is a terrible thing to waste."
apache drill> SHOW DATABASES;
+--------------------+
|   SCHEMA_NAME     |
+--------------------+
| cp.default        |
| dfs.default       |
| dfs.root          |
| dfs.tmp           |
| information_schema |
| kudu              |
| sys               |
+--------------------+
7 rows selected (24.818 seconds)
apache drill> use kudu;
+------+----------------------------------+
|  ok  |            summary             |
+------+----------------------------------+
| true | Default schema changed to [kudu] |
+------+----------------------------------+
1 row selected (0.357 seconds)
apache drill (kudu)> SHOW TABLES;
+--------------+--------------------------------+
| TABLE_SCHEMA |        TABLE_NAME          |
+--------------+--------------------------------+
| kudu      | impala::default.customer      |
| kudu      | impala::default.my_first_table |
+--------------+--------------------------------+
2 rows selected (9.045 seconds)

apache drill (kudu)> show tables;
+--------------+--------------------------------+
| TABLE_SCHEMA |        TABLE_NAME          |
+--------------+--------------------------------+
| kudu      | impala::default.customer      |
| kudu      | impala::default.my_first_table |
+--------------+--------------------------------+
  1. 现在尝试运行";从黑斑羚中选择*:default.customer";,根本无法运行它

>>>>>>>>>
apache drill (kudu)> SELECT * FROM `impala::default`.customer;
Error: VALIDATION ERROR: Schema [[impala::default]] is not valid with respect to either root schema or current default schema.

>>>>>>>>>
apache drill (kudu)> SELECT * FROM `default`.customer;
Error: VALIDATION ERROR: Schema [[default]] is not valid with respect to either root schema or current default schema.
Current default schema: kudu
[Error Id: 8a4ca4da-2488-4775-b2f3-443b8b4b17ef ] (state=,code=0)
Current default schema: kudu
[Error Id: ce96ea13-392f-4910-9f6c-789a6052b5c1 ] (state=,code=0)
apache drill (kudu)>
>>>>>>>>>

apache drill (kudu)> SELECT * FROM `impala`::`default`.customer;
Error: PARSE ERROR: Encountered ":" at line 1, column 23.
SQL Query: SELECT * FROM `impala`::`default`.customer
^
[Error Id: 5aacdd98-db6e-4308-9b33-90118efa3625 ] (state=,code=0)

>>>>>>>>>
apache drill (kudu)> SELECT * FROM `impala::`.`default`.customer;
Error: VALIDATION ERROR: Schema [[impala::, default]] is not valid with respect to either root schema or current default schema.
Current default schema: kudu
[Error Id: 5450bd90-dfcd-4efe-a8d3-b517be85b10a ] (state=,code=0)
>>>>>>>>>>>

在Drill约定中,FROM子句的第一部分是存储插件,在本例中是kudu。当您运行SHOW TABLES查询时,您看到表名实际上是impala::default.my_first_table。如果我没看错的话,那整个比特就是表名,下面的查询就是你应该如何转义它

请注意impala之前和first_table之后的反勾号,但其他地方没有。

SELECT * 
FROM kudu.`impala::default.my_first_table`

这对你有用吗?

相关内容

  • 没有找到相关文章

最新更新