This is an automated email from the ASF dual-hosted git repository.
richox pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git
The following commit(s) were added to refs/heads/master by this push:
new f514672b [AURON #1318][FOLLOWUP] Add test for `common_prefix_len`
(#1897)
f514672b is described below
commit f514672b61634eef673a2c089314d961c94c46a3
Author: cxzl25 <[email protected]>
AuthorDate: Tue Feb 3 11:09:41 2026 +0800
[AURON #1318][FOLLOWUP] Add test for `common_prefix_len` (#1897)
# Which issue does this PR close?
Closes #1318
# Rationale for this change
# What changes are included in this PR?
# Are there any user-facing changes?
# How was this patch tested?
---
native-engine/datafusion-ext-plans/src/sort_exec.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/native-engine/datafusion-ext-plans/src/sort_exec.rs
b/native-engine/datafusion-ext-plans/src/sort_exec.rs
index a39487c1..cc66f862 100644
--- a/native-engine/datafusion-ext-plans/src/sort_exec.rs
+++ b/native-engine/datafusion-ext-plans/src/sort_exec.rs
@@ -1454,6 +1454,7 @@ mod test {
prelude::SessionContext,
};
+ use super::common_prefix_len;
use crate::sort_exec::SortExec;
fn build_table_i32(
@@ -1492,6 +1493,21 @@ mod test {
)?))
}
+ // Verify that `common_prefix_len` correctly computes prefixes of small
fixed
+ // sizes. This ensures compiler optimizations do not incorrectly transform
+ // the function for small lengths.
+ #[test]
+ fn has_common_prefix_len_been_optimized_into_bogusness() {
+ let cpl = common_prefix_len(&[0; 8], &[0; 8]);
+ assert_eq!(cpl, 8);
+ let cpl = common_prefix_len(&[0; 4], &[0; 4]);
+ assert_eq!(cpl, 4);
+ let cpl = common_prefix_len(&[0; 2], &[0; 2]);
+ assert_eq!(cpl, 2);
+ let cpl = common_prefix_len(&[0; 1], &[0; 1]);
+ assert_eq!(cpl, 1);
+ }
+
#[tokio::test]
async fn test_sort_i32() -> Result<()> {
MemManager::init(100);