private Set<RelColumnOrigin> createDerivedColumnOrigins( Set<RelColumnOrigin> inputSet) { if (inputSet == null) { return null; } final Set<RelColumnOrigin> set = new HashSet<>(); for (RelColumnOrigin rco : inputSet) { RelColumnOrigin derived = new RelColumnOrigin( rco.getOriginTable(), rco.getOriginColumnOrdinal(), true); set.add(derived); } return set; } }
private Set<RelColumnOrigin> createDerivedColumnOrigins( Set<RelColumnOrigin> inputSet) { if (inputSet == null) { return null; } final Set<RelColumnOrigin> set = new HashSet<>(); for (RelColumnOrigin rco : inputSet) { RelColumnOrigin derived = new RelColumnOrigin( rco.getOriginTable(), rco.getOriginColumnOrdinal(), true); set.add(derived); } return set; } }
private Set<RelColumnOrigin> createDerivedColumnOrigins( Set<RelColumnOrigin> inputSet) { if (inputSet == null) { return null; } final Set<RelColumnOrigin> set = new HashSet<>(); for (RelColumnOrigin rco : inputSet) { RelColumnOrigin derived = new RelColumnOrigin( rco.getOriginTable(), rco.getOriginColumnOrdinal(), true); set.add(derived); } return set; } }
public Set<RelColumnOrigin> getColumnOrigins(TableScan tableScan, RelMetadataQuery mq, int iOutputColumn) { final Set<RelColumnOrigin> set = new HashSet<>(); RelOptTable table = tableScan.getTable(); if (table == null) { return null; } if (table.getRowType() != tableScan.getRowType()) { String columnName = tableScan.getRowType().getFieldNames().get(iOutputColumn); int newOutputColumn = 0; for (String tableCol : table.getRowType().getFieldNames()) { if (tableCol.equals(columnName)) { set.add(new RelColumnOrigin(table, newOutputColumn, false)); return set; } newOutputColumn++; } } else { set.add(new RelColumnOrigin(table, iOutputColumn, false)); } return set; }
public Set<RelColumnOrigin> getColumnOrigins(RelNode rel, RelMetadataQuery mq, int iOutputColumn) { // NOTE jvs 28-Mar-2006: We may get this wrong for a physical table // expression which supports projections. In that case, // it's up to the plugin writer to override with the // correct information. if (rel.getInputs().size() > 0) { // No generic logic available for non-leaf rels. return null; } final Set<RelColumnOrigin> set = new HashSet<>(); RelOptTable table = rel.getTable(); if (table == null) { // Somebody is making column values up out of thin air, like a // VALUES clause, so we return an empty set. return set; } // Detect the case where a physical table expression is performing // projection, and say we don't know instead of making any assumptions. // (Theoretically we could try to map the projection using column // names.) This detection assumes the table expression doesn't handle // rename as well. if (table.getRowType() != rel.getRowType()) { return null; } set.add(new RelColumnOrigin(table, iOutputColumn, false)); return set; }
public Set<RelColumnOrigin> getColumnOrigins(RelNode rel, RelMetadataQuery mq, int iOutputColumn) { // NOTE jvs 28-Mar-2006: We may get this wrong for a physical table // expression which supports projections. In that case, // it's up to the plugin writer to override with the // correct information. if (rel.getInputs().size() > 0) { // No generic logic available for non-leaf rels. return null; } final Set<RelColumnOrigin> set = new HashSet<>(); RelOptTable table = rel.getTable(); if (table == null) { // Somebody is making column values up out of thin air, like a // VALUES clause, so we return an empty set. return set; } // Detect the case where a physical table expression is performing // projection, and say we don't know instead of making any assumptions. // (Theoretically we could try to map the projection using column // names.) This detection assumes the table expression doesn't handle // rename as well. if (table.getRowType() != rel.getRowType()) { return null; } set.add(new RelColumnOrigin(table, iOutputColumn, false)); return set; }