use of com.actiontech.dble.plan.NamedField in project dble by actiontech.
the class PlanUtil method pushDownCol.
// ----------------help method------------
private static Item pushDownCol(PlanNode node, ItemField col) {
NamedField tmpField = new NamedField(col.getTableName(), col.getItemName(), null);
NamedField coutField = node.getInnerFields().get(tmpField);
return coutField.planNode.getOuterFields().get(coutField);
}
use of com.actiontech.dble.plan.NamedField in project dble by actiontech.
the class JoinNode method dealSingleStarColumn.
@Override
protected void dealSingleStarColumn(List<Item> newSels) {
if (usingFields == null) {
super.dealSingleStarColumn(newSels);
} else {
PlanNode driverNode = this.isRightOuterJoin() ? this.getRightNode() : this.getLeftNode();
String table = findTbNameByUsing(driverNode, usingFields.get(0));
for (String fieldName : usingFields) {
ItemField col = new ItemField(null, table, fieldName);
newSels.add(col);
}
for (NamedField field : innerFields.keySet()) {
if (usingFields.contains(field.getName())) {
continue;
}
ItemField col = new ItemField(null, field.getTable(), field.getName());
newSels.add(col);
}
}
}
use of com.actiontech.dble.plan.NamedField in project dble by actiontech.
the class MergeNode method setUpSelects.
@Override
protected void setUpSelects() {
columnsSelected.clear();
PlanNode firstNode = getChild();
outerFields.clear();
Set<NamedField> checkDup = new HashSet<>(firstNode.getOuterFields().size(), 1);
for (NamedField coutField : firstNode.getOuterFields().keySet()) {
ItemField column = new ItemField(null, null, coutField.getName());
NamedField tmpField = new NamedField(coutField.getTable(), coutField.getName(), this);
NamedField testDupField = new NamedField(null, coutField.getName(), this);
if (checkDup.contains(testDupField) && getParent() != null) {
throw new MySQLOutPutException(ErrorCode.ER_DUP_FIELDNAME, "", "Duplicate column name " + coutField.getName());
}
checkDup.add(testDupField);
outerFields.put(tmpField, column);
getColumnsSelected().add(column);
}
}
use of com.actiontech.dble.plan.NamedField in project dble by actiontech.
the class QueryNode method setUpInnerFields.
@Override
protected void setUpInnerFields() {
innerFields.clear();
for (PlanNode child : children) {
child.setUpFields();
for (NamedField childOutField : child.outerFields.keySet()) {
NamedField tmpField = new NamedField(this.getAlias(), childOutField.getName(), childOutField.planNode);
if (innerFields.containsKey(tmpField) && getParent() != null)
throw new MySQLOutPutException(ErrorCode.ER_DUP_FIELDNAME, "42S21", "Duplicate column name '" + childOutField.getName() + "'");
innerFields.put(tmpField, childOutField);
}
}
}
use of com.actiontech.dble.plan.NamedField in project dble by actiontech.
the class TableNode method setUpInnerFields.
@Override
protected void setUpInnerFields() {
innerFields.clear();
String tmpTable = alias == null ? tableName : alias;
for (StructureMeta.ColumnMeta cm : tableMeta.getColumnsList()) {
NamedField tmpField = new NamedField(tmpTable, cm.getName(), this);
innerFields.put(tmpField, tmpField);
}
}
Aggregations