From 1375633e6413e27bfc668e27a6802d52c6fccb19 Mon Sep 17 00:00:00 2001 From: huaxingao Date: Mon, 19 Aug 2024 14:43:36 -0700 Subject: [PATCH] formatting --- .../core/src/execution/datafusion/planner.rs | 52 ++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/native/core/src/execution/datafusion/planner.rs b/native/core/src/execution/datafusion/planner.rs index 9a8708603..0cc426e9c 100644 --- a/native/core/src/execution/datafusion/planner.rs +++ b/native/core/src/execution/datafusion/planner.rs @@ -1599,24 +1599,32 @@ impl PhysicalPlanner { .and_then(|inner| inner.lower_frame_bound_struct.as_ref()) { Some(l) => match l { - LowerFrameBoundStruct::UnboundedPreceding(_) => { - match units { - WindowFrameUnits::Rows => WindowFrameBound::Preceding(ScalarValue::UInt64(None)), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Preceding(ScalarValue::Int64(None)), + LowerFrameBoundStruct::UnboundedPreceding(_) => match units { + WindowFrameUnits::Rows => { + WindowFrameBound::Preceding(ScalarValue::UInt64(None)) } - } + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Preceding(ScalarValue::Int64(None)) + } + }, LowerFrameBoundStruct::Preceding(offset) => { let offset_value = offset.offset.abs() as i64; match units { - WindowFrameUnits::Rows => WindowFrameBound::Preceding(ScalarValue::UInt64(Some(offset_value as u64))), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Preceding(ScalarValue::Int64(Some(offset_value))), + WindowFrameUnits::Rows => WindowFrameBound::Preceding(ScalarValue::UInt64( + Some(offset_value as u64), + )), + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Preceding(ScalarValue::Int64(Some(offset_value))) + } } } LowerFrameBoundStruct::CurrentRow(_) => WindowFrameBound::CurrentRow, }, None => match units { WindowFrameUnits::Rows => WindowFrameBound::Preceding(ScalarValue::UInt64(None)), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Preceding(ScalarValue::Int64(None)), + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Preceding(ScalarValue::Int64(None)) + } }, }; @@ -1626,23 +1634,29 @@ impl PhysicalPlanner { .and_then(|inner| inner.upper_frame_bound_struct.as_ref()) { Some(u) => match u { - UpperFrameBoundStruct::UnboundedFollowing(_) => { - match units { - WindowFrameUnits::Rows => WindowFrameBound::Following(ScalarValue::UInt64(None)), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Following(ScalarValue::Int64(None)), + UpperFrameBoundStruct::UnboundedFollowing(_) => match units { + WindowFrameUnits::Rows => { + WindowFrameBound::Following(ScalarValue::UInt64(None)) } - } - UpperFrameBoundStruct::Following(offset) => { - match units { - WindowFrameUnits::Rows => WindowFrameBound::Following(ScalarValue::UInt64(Some(offset.offset as u64))), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Following(ScalarValue::Int64(Some(offset.offset as i64))), + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Following(ScalarValue::Int64(None)) } - } + }, + UpperFrameBoundStruct::Following(offset) => match units { + WindowFrameUnits::Rows => { + WindowFrameBound::Following(ScalarValue::UInt64(Some(offset.offset as u64))) + } + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Following(ScalarValue::Int64(Some(offset.offset as i64))) + } + }, UpperFrameBoundStruct::CurrentRow(_) => WindowFrameBound::CurrentRow, }, None => match units { WindowFrameUnits::Rows => WindowFrameBound::Following(ScalarValue::UInt64(None)), - WindowFrameUnits::Range | WindowFrameUnits::Groups => WindowFrameBound::Following(ScalarValue::Int64(None)), + WindowFrameUnits::Range | WindowFrameUnits::Groups => { + WindowFrameBound::Following(ScalarValue::Int64(None)) + } }, };