MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / includes_current_row

Method includes_current_row

src/expr/src/relation.rs:3922–3968  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

3920 }
3921
3922 fn includes_current_row(&self) -> bool {
3923 use WindowFrameBound::*;
3924 match self.start_bound {
3925 UnboundedPreceding => match self.end_bound {
3926 UnboundedPreceding => false,
3927 OffsetPreceding(0) => true,
3928 OffsetPreceding(_) => false,
3929 CurrentRow => true,
3930 OffsetFollowing(_) => true,
3931 UnboundedFollowing => true,
3932 },
3933 OffsetPreceding(0) => match self.end_bound {
3934 UnboundedPreceding => unreachable!(),
3935 OffsetPreceding(0) => true,
3936 // Any nonzero offsets here will create an empty window
3937 OffsetPreceding(_) => false,
3938 CurrentRow => true,
3939 OffsetFollowing(_) => true,
3940 UnboundedFollowing => true,
3941 },
3942 OffsetPreceding(_) => match self.end_bound {
3943 UnboundedPreceding => unreachable!(),
3944 // Window ends at the current row
3945 OffsetPreceding(0) => true,
3946 OffsetPreceding(_) => false,
3947 CurrentRow => true,
3948 OffsetFollowing(_) => true,
3949 UnboundedFollowing => true,
3950 },
3951 CurrentRow => true,
3952 OffsetFollowing(0) => match self.end_bound {
3953 UnboundedPreceding => unreachable!(),
3954 OffsetPreceding(_) => unreachable!(),
3955 CurrentRow => unreachable!(),
3956 OffsetFollowing(_) => true,
3957 UnboundedFollowing => true,
3958 },
3959 OffsetFollowing(_) => match self.end_bound {
3960 UnboundedPreceding => unreachable!(),
3961 OffsetPreceding(_) => unreachable!(),
3962 CurrentRow => unreachable!(),
3963 OffsetFollowing(_) => false,
3964 UnboundedFollowing => false,
3965 },
3966 UnboundedFollowing => false,
3967 }
3968 }
3969}
3970
3971/// Describe how frame bounds are interpreted

Callers 3

on_unique_window_aggMethod · 0.80
window_aggr_innerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected