我要搜索表名为test开头的表:有如下方法:
1. 使用HQL 和shell
[leo@hadoop ~]$ hive -e "use psi;show tables"|grep "^test"
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/hadoop/hive-0.9.0-bin/lib/hive-common-0.9.0.jar!/hive-log4j.properties
Hive history file=/tmp/leo/hive_job_log_leo_201308210323_591740476.txt
OK
Time taken: 3.653 seconds
OK
test3
testorg
testorgs
Time taken: 0.547 seconds
2.hive> show tables "test.*"
1. 使用HQL 和shell
[leo@hadoop ~]$ hive -e "use psi;show tables"|grep "^test"
WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
Logging initialized using configuration in jar:file:/home/hadoop/hive-0.9.0-bin/lib/hive-common-0.9.0.jar!/hive-log4j.properties
Hive history file=/tmp/leo/hive_job_log_leo_201308210323_591740476.txt
OK
Time taken: 3.653 seconds
OK
test3
testorg
testorgs
Time taken: 0.547 seconds
2.hive> show tables "test.*"