#NEWLINE# def test_show_tables( self ) : #NEWLINE# #INDENT# hql = "\n        CREATE TABLE test_show_tables_1 (a int) COMMENT 'Test for show_tables';\n        CREATE TABLE test_show_tables_2 (a int) COMMENT 'Test for show_tables';\n        CREATE TABLE test_show_tables_3 (a int) COMMENT 'Test for show_tables';\n      " #NEWLINE# resp = _make_query ( self . client , hql , database = self . db_name ) #NEWLINE# resp = wait_for_query_to_finish ( self . client , resp , max = 30.0 ) #NEWLINE# response = self . client . get ( ( '/metastore/tables/%s?filter=show_tables&format=json' % self . db_name ) ) #NEWLINE# assert_equal ( 200 , response . status_code ) #NEWLINE# data = json . loads ( response . content ) #NEWLINE# assert_equal ( len ( data [ 'tables' ] ) , 3 ) #NEWLINE# assert_true ( ( 'name' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# assert_true ( ( 'comment' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# assert_true ( ( 'type' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# hql = "\n        CREATE TABLE test_show_tables_4 (a int) COMMENT 'Test for show_tables';\n        CREATE TABLE test_show_tables_5 (a int) COMMENT 'Test for show_tables';\n      " #NEWLINE# resp = _make_query ( self . client , hql , database = self . db_name ) #NEWLINE# resp = wait_for_query_to_finish ( self . client , resp , max = 30.0 ) #NEWLINE# response = self . client . get ( ( '/metastore/tables/%s?filter=show_tables&format=json' % self . db_name ) ) #NEWLINE# assert_equal ( 200 , response . status_code ) #NEWLINE# data = json . loads ( response . content ) #NEWLINE# assert_equal ( len ( data [ 'tables' ] ) , 5 ) #NEWLINE# assert_true ( ( 'name' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# assert_true ( ( 'comment' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# assert_true ( ( 'type' in data [ 'tables' ] [ 0 ] ) ) #NEWLINE# hql = "\n        CREATE INDEX test_index ON TABLE test_show_tables_1 (a) AS 'COMPACT' WITH DEFERRED REBUILD;\n      " #NEWLINE# resp = _make_query ( self . client , hql , wait = True , local = False , max = 30.0 , database = self . db_name ) #NEWLINE# response = self . client . get ( ( '/metastore/tables/%s?format=json' % self . db_name ) ) #NEWLINE# assert_equal ( 200 , response . status_code ) #NEWLINE# data = json . loads ( response . content ) #NEWLINE# assert_false ( ( 'test_index' in data [ 'tables' ] ) )