mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-18 22:10:42 +00:00
feat(partition): add expression split utility (#7822)
* feat(partition): add expression split utility Implement MVP split logic with checker-safe degrade paths and move module under utils/split with aligned split naming and tests. Signed-off-by: WenyXu <wenymedia@gmail.com> * refactor: minor Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: header Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: styling Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): degrade split when branch becomes unsatisfiable Detect empty conjunction branches after split and return EmptyBranch instead of silently succeeding. This keeps split behavior aligned with expected partition semantics and adds regression tests for contradictory cuts. Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): tighten empty-branch split detection Handle Eq/NotEq contradictions and discrete-gap unsatisfiable ranges in split empty-branch checks. Add regression tests for equality conflicts and impossible int/date intervals. Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): degrade singleton and uint impossible split branches Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): enforce finite float bounds in split degradation Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): drop date and timestamp support from expr split Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): reject nan and infinity in expr split Signed-off-by: WenyXu <wenymedia@gmail.com> * refactor(partition): reuse conjunction bound collection in expr split Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: fmt Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: add comments Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(partition): respect null-first semantics in empty branch checks Signed-off-by: WenyXu <wenymedia@gmail.com> * refactor(partition): restrict expr split to range-only shapes Signed-off-by: WenyXu <wenymedia@gmail.com> * docs(partition): clarify split helper scope and test names Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: add comments Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
@@ -27,5 +27,6 @@ pub mod partition;
|
||||
pub mod simplify;
|
||||
pub mod splitter;
|
||||
pub mod subtask;
|
||||
pub mod utils;
|
||||
|
||||
pub use crate::partition::{PartitionRule, PartitionRuleRef};
|
||||
|
||||
15
src/partition/src/utils.rs
Normal file
15
src/partition/src/utils.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2023 Greptime Team
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
pub mod split;
|
||||
1263
src/partition/src/utils/split.rs
Normal file
1263
src/partition/src/utils/split.rs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user