@ Override public ResultSet getTables ( String catalog , String schemaPattern , String tableNamePattern , String [ ] types ) throws SQLException { checkClosed ( ) ; this . sysCatalog . setString ( 1 , "TABLES" ) ; JDBC4ResultSet res = ( JDBC4ResultSet ) this . sysCatalog . executeQuery ( ) ; VoltTable vtable = res . getVoltTable ( ) . clone ( 0 ) ; List < String > typeStrings = null ; if ( types != null ) { typeStrings = Arrays . asList ( types ) ; } // If no pattern is specified, default to matching any/all. if ( tableNamePattern == null || tableNamePattern . length ( ) == 0 ) { tableNamePattern = "%" ; } Pattern table_pattern = computeJavaPattern ( tableNamePattern ) ; // Filter tables based on type and pattern while ( res . next ( ) ) { if ( typeStrings == null || typeStrings . contains ( res . getString ( "TABLE_TYPE" ) ) ) { Matcher table_matcher = table_pattern . matcher ( res . getString ( "TABLE_NAME" ) ) ; if ( table_matcher . matches ( ) ) { vtable . addRow ( res . getRowData ( ) ) ; } } } return new JDBC4ResultSet ( this . sysCatalog , vtable ) ; }
Retrieves a description of the tables available in the given catalog .