[cloudera@quickstart ~]$ su
Password: cloudera
[root@quickstart cloudera]#
[root@quickstart cloudera] # impala-shell Starting Impala Shell without Kerberos authentication Connected to quickstart.cloudera:21000 Server version: impalad version 2.3.0-cdh5.5.0 RELEASE (build 0c891d79aa38f297d244855a32f1e17280e2129b) ********************************************************************* Welcome to the Impala shell. Copyright (c) 2015 Cloudera, Inc. All rights reserved. (Impala Shell v2.3.0-cdh5.5.0 (0c891d7) built on Mon Nov 9 12:18:12 PST 2015) Want to know what version of Impala you're connected to? Run the VERSION command to find out! ********************************************************************* [quickstart.cloudera:21000] >
[quickstart.cloudera:21000] > help; Documented commands (type help <topic>): ======================================================== compute describe insert set unset with version connect explain quit show values use exit history profile select shell tip Undocumented commands: ========================================= alter create desc drop help load summary
[quickstart.cloudera:21000] > version; Shell version: Impala Shell v2.3.0-cdh5.5.0 (0c891d7) built on Mon Nov 9 12:18:12 PST 2015 Server version: impalad version 2.3.0-cdh5.5.0 RELEASE (build 0c891d79aa38f297d244855a32f1e17280e2129b)
[quickstart.cloudera:21000] > history; [1]:version; [2]:help; [3]:show databases; [4]:use my_db; [5]:history;
[quickstart.cloudera:21000] > exit; Goodbye cloudera
[quickstart.cloudera:21000] > connect;
Connected to quickstart.cloudera:21000
Server version: impalad version 2.3.0-cdh5.5.0 RELEASE (build
0c891d79aa38f297d244855a32f1e17280e2129b)
[quickstart.cloudera:21000] > explain select * from sample; Query: explain select * from sample +------------------------------------------------------------------------------------+ | Explain String | +------------------------------------------------------------------------------------+ | Estimated Per-Host Requirements: Memory = 48.00MB VCores = 1 | | WARNING: The following tables are missing relevant table and/or column statistics. | | my_db.customers | | 01:EXCHANGE [UNPARTITIONED] | | 00:SCAN HDFS [my_db.customers] | | partitions = 1/1 files = 6 size = 148B | +------------------------------------------------------------------------------------+ Fetched 7 row(s) in 0.17s
[quickstart.cloudera:21000] > profile;
Query Runtime Profile:
Query (id=164b1294a1049189:a67598a6699e3ab6):
Summary:
Session ID: e74927207cd752b5:65ca61e630ad3ad
Session Type: BEESWAX
Start Time: 2016-04-17 23:49:26.08148000 End Time: 2016-04-17 23:49:26.2404000
Query Type: EXPLAIN
Query State: FINISHED
Query Status: OK
Impala Version: impalad version 2.3.0-cdh5.5.0 RELEASE (build 0c891d77280e2129b)
User: cloudera
Connected User: cloudera
Delegated User:
Network Address:10.0.2.15:43870
default Db: my_db
Sql Statement: explain select * from sample
Coordinator: quickstart.cloudera:22000
: 0ns
Query Timeline: 167.304ms
-Start execution: 41.292us (41.292us)-Planning finished: 56.42ms (56.386ms)
-Rows available: 58.247ms (1.819ms)
-First row fetched: 160.72ms (101.824ms)
-Unregister query: 166.325ms (6.253ms)
ImpalaServer:
-ClientFetchWaitTimer: 107.969ms
-RowMaterializationTimer: 0ns
| 命令和说明 |
|
Alter
alter 命令用于在 Impala 中更改表的结构和名称。
|
|
Describe
Impala 的
describe 命令给出了表的元数据。它包含列及其数据类型等信息。
describe 命令将
desc 作为快捷方式。
|
|
Drop
drop 命令用于从 Impala 中删除一个构造,其中构造可以是表、视图, 或数据库函数。
|
|
insert
Impala的
insert命令用于,
将数据(列)附加到表中。 覆盖现有表的数据。 覆盖现有表的数据。 |
|
select
select 语句用于对特定数据集执行所需的操作。它指定要在其上完成某些操作的数据集。您可以打印或存储(在文件中)select 语句的结果。
|
|
show
Impala 的
show 语句用于显示表、数据库、表等各种结构的元存储.
|
|
use
Impala 的
use 语句用于将当前上下文更改为所需的数据库。
|