Tuesday, 28 June 2022

Hive: Print all the databases that match to given regular expression

  Syntax 

SHOW DATABASES LIKE '{regular_expression}'

Example

SHOW DATABASES LIKE 'test*';

Above snippet print all the databases that starts with the string ‘test’.

hive> SHOW DATABASES;
OK
bigdatademo
default
testdb1
testdb2
Time taken: 0.011 seconds, Fetched: 4 row(s)
hive> ;
hive> ;
hive> SHOW DATABASES LIKE 'test*';
OK
testdb1
testdb2
Time taken: 0.036 seconds, Fetched: 2 row(s)
hive>



 

Previous                                                    Next                                                    Home

No comments:

Post a Comment