Skip to content

Commit

Permalink
fix: find time index
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 committed Dec 12, 2024
1 parent a1e649b commit 6f2c0dc
Show file tree
Hide file tree
Showing 3 changed files with 324 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/flow/src/transform/aggr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ impl KeyValPlan {

/// find out the column that should be time index in group exprs(which is all columns that should be keys)
/// TODO(discord9): better ways to assign time index
/// for now, it will found the first column that is timestamp or has a tumble window floor function
fn find_time_index_in_group_exprs(group_exprs: &[TypedExpr]) -> Option<usize> {
group_exprs.iter().position(|expr| {
matches!(
Expand All @@ -224,7 +225,7 @@ fn find_time_index_in_group_exprs(group_exprs: &[TypedExpr]) -> Option<usize> {
func: UnaryFunc::TumbleWindowFloor { .. },
expr: _
}
)
) || expr.typ.scalar_type.is_timestamp()
})
}

Expand Down
Loading

0 comments on commit 6f2c0dc

Please sign in to comment.