CONNECT
注意:'hs2'
'hs2-http'
--protocol
localhost
在shell启动期间连接到Impala:
# When you are connecting to an impalad running on the same machine.
# The prompt will reflect the current hostname.
$ impala-shell
# When you are connecting to an impalad running on a remote machine, and impalad is listening
# on a non-default port over the HTTP HiveServer2 protocol.
$ impala-shell -i some.other.hostname:port_number --protocol='hs2-http'
# When you are connecting to an impalad running on a remote machine, and impalad is listening
# on a non-default port.
$ impala-shell -i some.other.hostname:port_number
要在impala-shell会话中连接到Impala:
$ impala-shell
connect
[Not connected] > connect impalad-host
注意:
在特定数据库中启动impala-shell:
USE
# Subsequent queries with unqualified names operate on
# tables, views, and so on inside the database named 'staging'.
$ impala-shell -i localhost -d staging
# It is common during development, ETL, benchmarking, and so on
# to have different databases containing the same table names
# but with different contents or layouts.
$ impala-shell -i localhost -d parquet_snappy_compression
$ impala-shell -i localhost -d parquet_gzip_compression
# A utility command that you might run while developing shell scripts
# to manipulate HDFS files.
$ impala-shell -i localhost -d database_of_interest -q 'show tables'
# A sequence of CREATE TABLE, CREATE VIEW, and similar DDL statements
# can go into a file to make the setup process repeatable.
$ impala-shell -i localhost -d database_of_interest -f recreate_tables.sql