Fix bug: compare column with equals rather than == (#1850)

This commit is contained in:
xionglei0
2019-09-24 09:40:11 +08:00
committed by ZHAO Chun
parent c3fccb7a49
commit b756dfd90b
3 changed files with 14 additions and 14 deletions

View File

@ -1032,19 +1032,6 @@ public class Analyzer {
return false;
}
/**
* Return slot descriptor corresponding to column referenced in the context
* of tupleDesc, or null if no such reference exists.
*/
public SlotDescriptor getColumnSlot(TupleDescriptor tupleDesc, Column col) {
for (SlotDescriptor slotDesc : tupleDesc.getSlots()) {
if (slotDesc.getColumn() == col) {
return slotDesc;
}
}
return null;
}
public DescriptorTable getDescTbl() {
return globalState.descTbl;
}

View File

@ -102,6 +102,19 @@ public class TupleDescriptor {
return result;
}
/**
* Return slot descriptor corresponding to column referenced in the context
* of tupleDesc, or null if no such reference exists.
*/
public SlotDescriptor getColumnSlot(String columnName) {
for (SlotDescriptor slotDesc : slots) {
if (slotDesc.getColumn() != null && slotDesc.getColumn().getName().equalsIgnoreCase(columnName)) {
return slotDesc;
}
}
return null;
}
public Table getTable() {
return table;
}

View File

@ -1261,7 +1261,7 @@ public class SingleNodePlanner {
Map<String, PartitionColumnFilter> columnFilters = Maps.newHashMap();
List<Expr> conjuncts = analyzer.getUnassignedConjuncts(scanNode);
for (Column column : tblRef.getTable().getBaseSchema()) {
SlotDescriptor slotDesc = analyzer.getColumnSlot(tblRef.getDesc(), column);
SlotDescriptor slotDesc = tblRef.getDesc().getColumnSlot(column.getName());
if (null == slotDesc) {
continue;
}