Skip to content

Commit 07f247c

Browse files
committed
Fix SingleTimeMonotonic to take into account FlatMap's TableFunc's preserves_monotonicity
1 parent 779f893 commit 07f247c

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/compute-types/src/plan/interpret/physically_monotonic.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,10 @@ impl Interpreter for SingleTimeMonotonic<'_> {
139139
_input_key: &Option<Vec<MirScalarExpr>>,
140140
input: Self::Domain,
141141
_exprs: &Vec<MirScalarExpr>,
142-
_func: &TableFunc,
142+
func: &TableFunc,
143143
_mfp: &MapFilterProject,
144144
) -> Self::Domain {
145-
// In a single-time context, we just propagate the monotonicity
146-
// status of the input
147-
input
145+
PhysicallyMonotonic(input.0 && func.preserves_monotonicity())
148146
}
149147

150148
fn join(

test/sqllogictest/transform/relax_must_consolidate.slt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ Explained Query:
12291229
Reduce::Hierarchical
12301230
aggr_funcs=[max]
12311231
monotonic
1232+
must_consolidate
12321233
key_plan
12331234
project=()
12341235
val_plan=id

0 commit comments

Comments
 (0)