public static List<Table> getNormalTables(Database catalog, boolean isReplicated) {
        List<Table> tables = new ArrayList<>();
        for (Table table : catalog.getTables()) {
            if ((table.getIsreplicated() == isReplicated) &&
                    table.getMaterializer() == null &&
                    !CatalogUtil.isTableExportOnly(catalog, table)) {
                tables.add(table);
                continue;
            }
            //Handle views which are on STREAM only partitioned STREAM allow view and must have partition
            //column as part of view.
            if ((table.getMaterializer() != null) && !isReplicated
                    && (CatalogUtil.isTableExportOnly(catalog, table.getMaterializer()))) {
                //Non partitioned export table are not allowed so it should not get here.
                Column bpc = table.getMaterializer().getPartitioncolumn();
                if (bpc != null) {
                    String bPartName = bpc.getName();
                    Column pc = table.getColumns().get(bPartName);
                    if (pc != null) {
                        tables.add(table);
                    }
                }
            }
        }
        return tables;
    }
public static List < Table > getNormalTables ( Database catalog , boolean isReplicated ) { List < Table > tables = new ArrayList < > ( ) ; for ( Table table : catalog . getTables ( ) ) { if ( ( table . getIsreplicated ( ) == isReplicated ) && table . getMaterializer ( ) == null && ! CatalogUtil . isTableExportOnly ( catalog , table ) ) { tables . add ( table ) ; continue ; } if ( ( table . getMaterializer ( ) != null ) && ! isReplicated && ( CatalogUtil . isTableExportOnly ( catalog , table . getMaterializer ( ) ) ) ) { Column bpc = table . getMaterializer ( ) . getPartitioncolumn ( ) ; if ( bpc != null ) { String bPartName = bpc . getName ( ) ; Column pc = table . getColumns ( ) . get ( bPartName ) ; if ( pc != null ) { tables . add ( table ) ; } } } } return tables ; }
Get all normal tables from the catalog. A normal table is one that's NOT a materialized
view, nor an export table. For the lack of a better name, I call it normal.
@param catalog         Catalog database
@param isReplicated    true to return only replicated tables,
false to return all partitioned tables
@return A list of tables