当前位置:K88软件开发文章中心大数据impala → 文章内容

impala Shell

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-26 10:07:42

由 jojocool 创建,youj 最后一次修改 2016-12-19 在前面的章节中,我们已经看到了使用cloudera及其体系结构安装Impala。 Impala shell(命令提示符) Hue (用户界面) ODBC和JDBC(第三方库) 本章介绍如何启动Impala Shell和shell的各种选项。 Impala Shell命令参考Impala shell的命令分为一般命令,查询特定选项以及表和数据库特定选项,如下所述。 通用命令helpversionhistoryshell (or) !connectexit | quit查询特定的选项Set/unsetProfileExplain表和数据库特定选项Alterdescribedropinsertselectshowuse启动Impala Shell打开cloudera终端,以超级用户身份登录,然后键入cloudera作为密码,如下所示。 [cloudera@quickstart ~]$ suPassword: cloudera[root@quickstart cloudera]#通过键入以下命令启动Impala shell - [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] >Impala - 通用命令Impala的通用命令解释如下 -  help命令Impala shell的help命令提供了Impala中可用的命令的列表 - [quickstart.cloudera:21000] > help; Documented commands (type help <topic>):========================================================compute describe insert set unset with versionconnect explain quit show values useexit history profile select shell tip Undocumented commands:========================================= alter create desc drop help load summary version命令 version命令为您提供Impala的当前版本,如下所示。 [quickstart.cloudera:21000] > version;Shell version: Impala Shell v2.3.0-cdh5.5.0 (0c891d7) built on Mon Nov 9 12:18:12 PST 2015Server version: impalad version 2.3.0-cdh5.5.0 RELEASE (build 0c891d79aa38f297d244855a32f1e17280e2129b)history命令Impala的history命令显示在shell中执行的最后10个命令。 以下是历史命令的示例。 这里我们执行了5个命令,即版本,帮助,显示,使用和历史。 [quickstart.cloudera:21000] > history;[1]:version;[2]:help;[3]:show databases;[4]:use my_db;[5]:history;quit/exit命令您可以使用quit或exit命令从Impala shell中弹出,如下所示。 [quickstart.cloudera:21000] > exit; Goodbye clouderaconnect命令 connect命令用于连接到Impala的给定实例。 如果没有指定任何实例,则它将连接到默认端口21000,如下所示。 [quickstart.cloudera:21000] > connect; Connected to quickstart.cloudera:21000 Server version: impalad version 2.3.0-cdh5.5.0 RELEASE (build 0c891d79aa38f297d244855a32f1e17280e2129b)Impala查询特定选项Impala的特定于查询的命令接受查询。 它们在下面解释 -  说明 explain命令返回给定查询的执行计划。 [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简介 profile命令显示有关最近查询的低级信息。 此命令用于查询的诊断和性能调整。 以下是配置文件命令的示例。 在这种情况下,profile命令返回说明查询的低级信息。[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)

[1] [2]  下一页


impala Shell