public static Schema merge(Schema left, Schema right) { Schema merged = new Schema(); for(Column col : left.getRootColumns()) { if (!merged.containsByQualifiedName(col.getQualifiedName())) { merged.addColumn(col); } } for(Column col : right.getRootColumns()) { if (merged.containsByQualifiedName(col.getQualifiedName())) { merged.addColumn("?fake" + (tmpColumnSeq++), col.getDataType()); } else { merged.addColumn(col); } } // if overflow if (tmpColumnSeq < 0) { tmpColumnSeq = 0; } return merged; }
public static Schema targetToSchema(Target[] targets) { Schema schema = new Schema(); for (Target t : targets) { DataType type = t.getEvalTree().getValueType(); String name; if (t.hasAlias()) { name = t.getAlias(); } else { name = t.getEvalTree().getName(); } if (!schema.containsByQualifiedName(name)) { schema.addColumn(name, type); } } return schema; }
LogicalPlan.QueryBlock parentBlock = plan.getParentBlock(current); for (RelationNode relationNode : parentBlock.getRelations()) { if (relationNode.getLogicalSchema().containsByQualifiedName(columnRef.getCanonicalName())) { throw new TajoRuntimeException(new NotImplementedException("Correlated subquery"));
LogicalPlan.QueryBlock parentBlock = plan.getParentBlock(current); for (RelationNode relationNode : parentBlock.getRelations()) { if (relationNode.getLogicalSchema().containsByQualifiedName(columnRef.getCanonicalName())) { throw new TajoRuntimeException(new NotImplementedException("Correlated subquery"));