[fix](planner)literal expr should do nothing in substituteImpl() method (#23438)
substitute a literal expr is pointless and wrong. This pr keep literal expr unchanged during substitute process
This commit is contained in:
@ -402,4 +402,10 @@ public abstract class LiteralExpr extends Expr implements Comparable<LiteralExpr
|
||||
public boolean matchExprs(List<Expr> exprs, SelectStmt stmt, boolean ignoreAlias, TupleDescriptor tuple) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Expr substituteImpl(ExprSubstitutionMap smap, ExprSubstitutionMap disjunctsMap,
|
||||
Analyzer analyzer) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,3 +4,6 @@
|
||||
2
|
||||
3
|
||||
|
||||
-- !select2 --
|
||||
0 2.0
|
||||
|
||||
|
||||
@ -63,6 +63,21 @@ suite("test_subquery_with_agg") {
|
||||
subq_1.gid;
|
||||
"""
|
||||
|
||||
qt_select2 """
|
||||
select
|
||||
0 as row_number,
|
||||
round(sum(num) / 10, 0) as org_id
|
||||
from
|
||||
(
|
||||
select
|
||||
num
|
||||
from
|
||||
agg_subquery_table
|
||||
) t
|
||||
group by
|
||||
1;
|
||||
"""
|
||||
|
||||
sql """
|
||||
drop table if exists agg_subquery_table;
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user