mirror of
https://github.com/apache/impala.git
synced 2026-01-04 09:00:56 -05:00
Query:SHOW FILES IN db.table Result: +---------------------------------------------+------+---------------------+ | path | size | partition | +---------------------------------------------+------+---------------------+ | hdfs://namenode/path/to/partition/file1.dat | 128B | year=2010, month=11 | | hdfs://namenode/path/to/partition/file2.dat | 256B | year=2010, month=12 | | hdfs://namenode/path/to/partition/file3.dat | 1.3G | year=2011, month=1 | +---------------------------------------------+------+---------------------+ Query:SHOW FILES IN db.table PARTITION(year=2010, month=12) Result: +---------------------------------------------+------+---------------------+ | path | size | partition | +---------------------------------------------+------+---------------------+ | hdfs://namenode/path/to/partition/file2.dat | 256B | year=2010, month=12 | +---------------------------------------------+------+---------------------+ Only support Hdfs tables. Will throw exceptions for other kinds of table. Partition is optional. Will throw exception if specified partition cannot be found. Change-Id: I6480ed87ab6cdfb02a60bffa72a8047a161f92ab Reviewed-on: http://gerrit.cloudera.org:8080/19 Reviewed-by: Henry Robinson <henry@cloudera.com> Tested-by: Internal Jenkins
240 lines
5.9 KiB
Plaintext
240 lines
5.9 KiB
Plaintext
====
|
|
---- QUERY
|
|
# use functional
|
|
use functional
|
|
====
|
|
---- QUERY
|
|
# Simple pattern literal
|
|
show tables "alltypes"
|
|
---- RESULTS
|
|
'alltypes'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Pattern with wildcard
|
|
show tables "all*ypes"
|
|
---- RESULTS
|
|
'alltypes'
|
|
'allcomplextypes'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Empty string matches nothing
|
|
show tables ""
|
|
---- RESULTS
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Check that regex metacharacters are being escaped
|
|
show tables '+alltypes'
|
|
---- RESULTS
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Fully qualified names will not match
|
|
show tables "functional.alltypes"
|
|
---- RESULTS
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Database names are case insensitive.
|
|
USE FUNCTIONAL
|
|
---- RESULTS
|
|
====
|
|
---- QUERY
|
|
# Different database
|
|
# We have no SHOW TABLES with no pattern test since the set of tables is
|
|
# changing often, and may be different depending on whether benchmark data is
|
|
# loaded, for example.
|
|
show tables '*'
|
|
---- RESULTS: VERIFY_IS_SUBSET
|
|
'alltypes'
|
|
'alltypesagg'
|
|
'alltypesaggmultifiles'
|
|
'alltypesaggmultifilesnopart'
|
|
'alltypesaggnonulls'
|
|
'alltypeserror'
|
|
'alltypeserrornonulls'
|
|
'alltypesinsert'
|
|
'alltypesmixedformat'
|
|
'alltypesnopart'
|
|
'alltypesnopart_insert'
|
|
'alltypessmall'
|
|
'alltypestiny'
|
|
'dimtbl'
|
|
'emptytable'
|
|
'escapechartesttable'
|
|
'greptiny'
|
|
'insert_overwrite_nopart'
|
|
'insert_overwrite_partitioned'
|
|
'jointbl'
|
|
'liketbl'
|
|
'nullescapedtable'
|
|
'nullinsert'
|
|
'nullinsert_alt'
|
|
'nulltable'
|
|
'overflow'
|
|
'rankingssmall'
|
|
'stringpartitionkey'
|
|
'tblwithraggedcolumns'
|
|
'testtbl'
|
|
'text_comma_backslash_newline'
|
|
'text_dollar_hash_pipe'
|
|
'tinyinttable'
|
|
'tinytable'
|
|
'uservisitssmall'
|
|
'zipcode_incomes'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Choice amongst patterns
|
|
show tables "alltypes|stringpartitionkey|testtbl"
|
|
---- RESULTS
|
|
'alltypes'
|
|
'stringpartitionkey'
|
|
'testtbl'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Show tables in
|
|
show tables in functional
|
|
---- RESULTS: VERIFY_IS_SUBSET
|
|
'alltypes'
|
|
'alltypesagg'
|
|
'alltypesaggmultifiles'
|
|
'alltypesaggmultifilesnopart'
|
|
'alltypesaggnonulls'
|
|
'alltypeserror'
|
|
'alltypeserrornonulls'
|
|
'alltypesinsert'
|
|
'alltypesmixedformat'
|
|
'alltypesnopart'
|
|
'alltypesnopart_insert'
|
|
'alltypessmall'
|
|
'alltypestiny'
|
|
'dimtbl'
|
|
'emptytable'
|
|
'escapechartesttable'
|
|
'greptiny'
|
|
'insert_overwrite_nopart'
|
|
'insert_overwrite_partitioned'
|
|
'jointbl'
|
|
'liketbl'
|
|
'nullescapedtable'
|
|
'nullinsert'
|
|
'nullinsert_alt'
|
|
'nulltable'
|
|
'overflow'
|
|
'rankingssmall'
|
|
'stringpartitionkey'
|
|
'tblwithraggedcolumns'
|
|
'testtbl'
|
|
'text_comma_backslash_newline'
|
|
'text_dollar_hash_pipe'
|
|
'tinyinttable'
|
|
'tinytable'
|
|
'uservisitssmall'
|
|
'zipcode_incomes'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Show tables in with a pattern
|
|
show tables in functional like 'alltypesagg*'
|
|
---- RESULTS
|
|
'alltypesagg'
|
|
'alltypesaggmultifiles'
|
|
'alltypesaggmultifilesnopart'
|
|
'alltypesaggnonulls'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Coverage of syntax variations.
|
|
show tables in functional 'alltypesagg'
|
|
---- RESULTS
|
|
'alltypesagg'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show tables in functional like 'alltypesagg'
|
|
---- RESULTS
|
|
'alltypesagg'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show tables 'alltypesagg'
|
|
---- RESULTS
|
|
'alltypesagg'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show tables like 'alltypesagg'
|
|
---- RESULTS
|
|
'alltypesagg'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
# Show databases
|
|
show databases like 'tpcds'
|
|
---- RESULTS
|
|
'tpcds'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show databases like 'functional'
|
|
---- RESULTS
|
|
'functional'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show databases like 'functional'
|
|
---- RESULTS
|
|
'functional'
|
|
---- TYPES
|
|
STRING
|
|
====
|
|
---- QUERY
|
|
show files in insert_string_partitioned
|
|
---- RESULTS
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
---- TYPES
|
|
STRING,STRING,STRING
|
|
====
|
|
---- QUERY
|
|
show files in functional.insert_string_partitioned
|
|
---- RESULTS
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
---- TYPES
|
|
STRING,STRING,STRING
|
|
====
|
|
---- QUERY
|
|
show files in insert_string_partitioned partition(s2='__HIVE_DEFAULT_PARTITION__')
|
|
---- RESULTS
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
row_regex: '$NAMENODE/test-warehouse/functional.db/insert_string_partitioned/s2=__HIVE_DEFAULT_PARTITION__/[a-z0-9]+\-[a-z0-9]+_\d+_data\.\d+\..*','7B','s2=__HIVE_DEFAULT_PARTITION__'
|
|
---- TYPES
|
|
STRING,STRING,STRING
|
|
====
|