for (Table tmp : parentTables) {
for (Row row : tmp.getRows(0, tmp.getNumRows(), selection)) {
parentRows.add(row);
}
}
HNode newNode = ht.addHNode(ht.getNewColumnName("Glue"), HNodeType.Transformation, oldws, factory);
outputColumns.add(newNode.getId());
newhNodeId = newNode.getId();
HTable newht = newNode.addNestedTable(newNode.getColumnName(), oldws, factory);
List<HNode> childHNodes = new ArrayList<HNode>();
for (HNode hnode : hnodes) {
if (hnode.hasNestedTable()) {
for (HNode hn : hnode.getNestedTable().getHNodes()) {
childHNodes.add(hn);
}
}
}
Map<String, String> mapping = CloneTableUtils.cloneHTable(ht, newht, oldws, factory, childHNodes, selection);
for (Entry<String, String> entry : mapping.entrySet()) {
outputColumns.add(entry.getValue());
}
for (Row parentRow : parentRows) {
Table t = null;
for (Node node : parentRow.getNodes()) {
if (node.hasNestedTable() && node.getNestedTable().getHTableId().compareTo(ht.getId()) == 0) {
t = node.getNestedTable();
break;
}
}
ArrayList<Row> rows = t.getRows(0, t.getNumRows(), selection);
for (Row row : rows) {
Table nestedTable = row.getNeighbor(newNode.getId()).getNestedTable();
generateRows(hnodes, selection, row, nestedTable, factory, mapping, childHNodes, newht);
}
}
}