private void handleFinalTableScan(TableScan tableScan) { RelOptTableImpl relOptTable = ((RelOptTableImpl) tableScan.getTable()); List<String> tableAlias = createTableAlias(relOptTable.getNames()); rootNodeSchemas.put(this.relNode, new AbstractMap.SimpleEntry<>(tableAlias.get(0), tableScan.getTable())); }
private void pruneSubtree(RelNode parent, TableScan scan, int leftOrRight) { RelOptTableImpl lowLevelTable = ((RelOptTableImpl) scan.getTable()); List<String> newNames = createTableAlias(lowLevelTable.getNames()); RelNode originChild = parent.getInputs().get(leftOrRight); executePruningSubtree(originChild, scan.getTable(), newNames.get(0)); TableScan tempTableScan = createTemporaryTableScan(lowLevelTable, newNames, scan, originChild); parent.replaceInput(leftOrRight, tempTableScan); }