// Make sure that the columns that remain for the edges to our target tables
// are only connected through the column that the target tables were partitioned on
Collection<Column> columns;
for (Table catalog_tbl : catalog_db.getTables()) {
if (targets.contains(catalog_tbl) || catalog_tbl.getSystable()) continue;
DesignerVertex v0 = agraph.getVertex(catalog_tbl);
try {
columns = cp.getCandidateValues(catalog_tbl, Column.class);
} catch (IllegalArgumentException ex) {
continue;
}
assertNotNull(columns);
assertFalse(columns.isEmpty());
System.err.println(String.format("Examining %d columns for %s", columns.size(), catalog_tbl));
// For each column that is still available for this table, check to make sure that:
// (1) It does not have an unmarked edge to one of our target tables
// (2) If it is does have an edge to one of target tables then that edge uses the column that the table is partitioned on
for (Column catalog_col : columns) {
if (catalog_col instanceof ReplicatedColumn) continue;
Collection<DesignerEdge> edges = agraph.findEdgeSet(v0, catalog_col);
assertNotNull(catalog_col.fullName(), edges);
assertFalse(catalog_col.fullName(), edges.isEmpty());
for (DesignerEdge e : edges) {
if (cp.isMarked(e)) continue;
DesignerVertex v1 = agraph.getOpposite(v0, e);
assertNotNull(e.toString(), v1);
Table other_tbl = v1.getCatalogItem();
assertNotNull(other_tbl);
// Skip if not one of our target tables
if (targets.contains(other_tbl) == false || other_tbl.getPartitioncolumn() == null) continue;