Collections.sort(dbNames);
for (String dbName : dbNames) {
List<String> tableNames = metastoreClient.getTables(dbName, tablePattern);
Collections.sort(tableNames);
for (Table table : metastoreClient.getTableObjectsByName(dbName, tableNames)) {
TableSchema schema = new TableSchema(metastoreClient.getSchema(dbName, table.getTableName()));
for (ColumnDescriptor column : schema.getColumnDescriptors()) {
if (columnPattern != null && !columnPattern.matcher(column.getName()).matches()) {
continue;
}
Object[] rowData = new Object[] {
null, // TABLE_CAT