Section 1 IMPALA: 8, impala use the interactive shell window

metadata synchronization issues among impala
impala among database tables created, you could see directly, without having to refresh
the database tables hive which created the need to refresh the metadata to be able to see

Because the catalog service impala, we need to refresh mechanism, metadata hive of information among the tables, save to catalog come inside, to be able to see impala

=====================================================

9, impala use

9.1, impala-shell syntax

9.1.1 External impala-shell command parameter syntax

You do not need to enter the command parameter impala-shell interactive command line which can be executed

impala-shell when executed later can take a number of parameters:

-h help documentation

impala-shell -h

 

-r to refresh the entire metadata, when a large amount of data, more consumption of server performance

impala-shell -r

 

-B to format, query large amounts of data can improve performance

   --print_header to format the display column name

  --output_delimiter specify the delimiter

-v view the corresponding version

impala-shell -v -V

 

-f execute the query file

              --query_file specify the query file

cd /export/servers

vim impala-shell.sql

use weblog;

select * from ods_click_pageviews limit 10;

 

To execute the query by -f parameter file

impala-shell -f impala-shell.sql

 

 

-i connected to impalad

              --impalad designated impalad to perform the task

-o save the results to a file which go

              --output_file specify the output file name

impala-shell -f impala-shell.sql -o hello.txt

 

-p Displays the query plan

impala-shell -f impala-shell.sql -p

 

-q Do not use impala-shell query

 

9.1.2, impala-shell internal command line parameter syntax

After entering the syntax impala-shell command line can be executed

help command

Help documentation

 

connect command

connect hostname to connect to a machine to perform the above

 

refresh command

refresh dbname.tablename incremental refresh, a refresh of a metadata table, mainly for refreshing data of the data table changes inside the hive which case

refresh mydb.stu;

 

 

invalidate  metadata 命令:

invalidate metadata refresh the whole amount, a large consumption performance, which is mainly used in the new hive database or database tables when refresh is performed

 

 

explain the command:

For viewing sql statement execution plan

explain select * from stu;

 

Explain value may be set to several values ​​0,1,2,3 the like, where the level 3 is the highest, can print out the most complete information

set explain_level=3;

 

 

profile command:

After executing sql statement execution, you can print a more detailed implementation steps,

Mainly used to query results view, excellent tone clusters

select * from stu;

profile;

 

Note: insert in the hive window which data or new database or database tables, in impala which is not a query directly to the need to refresh the database, inserted in impala-shell which data, in impala which can query directly to, do not need to refresh the database, which is the catalog to use this feature service implementation, catalog is added after impala1.2 version of the module functions, the main role is to synchronize metadata between impala

Guess you like

Origin www.cnblogs.com/mediocreWorld/p/11141153.html