Signed-off-by: shuming.li <ming.moriarty@gmail.com> Co-authored-by: shuming.li <ming.moriarty@gmail.com>
This commit is contained in:
parent
6d8f208910
commit
0652d618ec
|
|
@ -312,7 +312,7 @@ public class MVPartitionExprResolver {
|
|||
if (item instanceof SlotRef) {
|
||||
SlotRef result = (SlotRef) item;
|
||||
TableName actTableName = result.getTblNameWithoutAnalyzed();
|
||||
if (result.getColumnName().equalsIgnoreCase(slot.getColumnName())
|
||||
if (result.getColumnName() != null && result.getColumnName().equalsIgnoreCase(slot.getColumnName())
|
||||
&& (expTableName == null || expTableName.equals(actTableName))) {
|
||||
return visitExpr(context.withExpr(result).withRelation(relation));
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ public class MVPartitionExprResolver {
|
|||
SlotRef slot = context.getSlotRef();
|
||||
if (slot.getTblNameWithoutAnalyzed() != null) {
|
||||
String tableName = slot.getTblNameWithoutAnalyzed().getTbl();
|
||||
if (!node.getAlias().getTbl().equalsIgnoreCase(tableName)) {
|
||||
if (node.getAlias() != null && !node.getAlias().getTbl().equalsIgnoreCase(tableName)) {
|
||||
return null;
|
||||
}
|
||||
slot = (SlotRef) slot.clone();
|
||||
|
|
@ -348,7 +348,7 @@ public class MVPartitionExprResolver {
|
|||
public Exprs visitTable(TableRelation node, MVExprContext context) {
|
||||
SlotRef slot = context.getSlotRef();
|
||||
TableName tableName = slot.getTblNameWithoutAnalyzed();
|
||||
if (node.getName().equals(tableName)) {
|
||||
if (node.getName() != null && node.getName().equals(tableName)) {
|
||||
return Exprs.of(slot);
|
||||
}
|
||||
if (tableName != null && !node.getResolveTableName().equals(tableName)) {
|
||||
|
|
@ -515,7 +515,7 @@ public class MVPartitionExprResolver {
|
|||
if (slot.getTblNameWithoutAnalyzed() != null) {
|
||||
String tableName = slot.getTblNameWithoutAnalyzed().getTbl();
|
||||
String cteName = node.getAlias() != null ? node.getAlias().getTbl() : node.getName();
|
||||
if (!cteName.equalsIgnoreCase(tableName)) {
|
||||
if (cteName != null && !cteName.equalsIgnoreCase(tableName)) {
|
||||
return null;
|
||||
}
|
||||
slot = (SlotRef) slot.clone();
|
||||
|
|
|
|||
Loading…
Reference in New Issue