mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-04 08:12:54 +00:00
Compare commits
1 Commits
columnar-c
...
column-tra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a072e3c18 |
@@ -92,6 +92,7 @@ pub struct FastFieldStats {
|
|||||||
|
|
||||||
struct VecColum<'a>(&'a [u64]);
|
struct VecColum<'a>(&'a [u64]);
|
||||||
impl<'a> Column for VecColum<'a> {
|
impl<'a> Column for VecColum<'a> {
|
||||||
|
|
||||||
fn get_val(&self, position: u64) -> u64 {
|
fn get_val(&self, position: u64) -> u64 {
|
||||||
self.0[position as usize]
|
self.0[position as usize]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ impl From<FastFieldCodecType> for FastFieldCodecEnableCheck {
|
|||||||
|
|
||||||
// use this, when this is merged and stabilized explicit_generic_args_with_impl_trait
|
// use this, when this is merged and stabilized explicit_generic_args_with_impl_trait
|
||||||
// https://github.com/rust-lang/rust/pull/86176
|
// https://github.com/rust-lang/rust/pull/86176
|
||||||
fn codec_estimation<C: FastFieldCodec, D: Column>(
|
fn codec_estimation<C: FastFieldCodec>(
|
||||||
fastfield_accessor: &D,
|
fastfield_accessor: &impl Column,
|
||||||
estimations: &mut Vec<(f32, FastFieldCodecType)>,
|
estimations: &mut Vec<(f32, FastFieldCodecType)>,
|
||||||
) {
|
) {
|
||||||
if let Some(ratio) = C::estimate(fastfield_accessor) {
|
if let Some(ratio) = C::estimate(fastfield_accessor) {
|
||||||
@@ -202,13 +202,13 @@ impl CompositeFastFieldSerializer {
|
|||||||
let mut estimations = vec![];
|
let mut estimations = vec![];
|
||||||
|
|
||||||
if codec_enable_checker.is_enabled(FastFieldCodecType::Bitpacked) {
|
if codec_enable_checker.is_enabled(FastFieldCodecType::Bitpacked) {
|
||||||
codec_estimation::<BitpackedCodec, _>(&fastfield_accessor, &mut estimations);
|
codec_estimation::<BitpackedCodec>(&fastfield_accessor, &mut estimations);
|
||||||
}
|
}
|
||||||
if codec_enable_checker.is_enabled(FastFieldCodecType::Linear) {
|
if codec_enable_checker.is_enabled(FastFieldCodecType::Linear) {
|
||||||
codec_estimation::<LinearCodec, _>(&fastfield_accessor, &mut estimations);
|
codec_estimation::<LinearCodec>(&fastfield_accessor, &mut estimations);
|
||||||
}
|
}
|
||||||
if codec_enable_checker.is_enabled(FastFieldCodecType::BlockwiseLinear) {
|
if codec_enable_checker.is_enabled(FastFieldCodecType::BlockwiseLinear) {
|
||||||
codec_estimation::<BlockwiseLinearCodec, _>(&fastfield_accessor, &mut estimations);
|
codec_estimation::<BlockwiseLinearCodec>(&fastfield_accessor, &mut estimations);
|
||||||
}
|
}
|
||||||
if let Some(broken_estimation) = estimations.iter().find(|estimation| estimation.0.is_nan())
|
if let Some(broken_estimation) = estimations.iter().find(|estimation| estimation.0.is_nan())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user