Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collect columns for merge #1812

Merged
merged 3 commits into from
Jan 20, 2023
Merged

collect columns for merge #1812

merged 3 commits into from
Jan 20, 2023

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Jan 19, 2023

No description provided.

@PSeitz PSeitz force-pushed the use_columnar branch 2 times, most recently from 5a8108a to b00869c Compare January 19, 2023 11:51
let end = multivalued_index.get_val(row_id + 1);
start..end
unimplemented!()
// let start = multivalued_index.get_val(row_id);
Copy link
Collaborator

@fulmicoton fulmicoton Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why unimplemented!? Did you spot a bug?

/// Returns a list of `DynamicColumn` which are all of the same numerical type
fn cast_to_common_numerical_column(columns: &[DynamicColumn]) -> Vec<DynamicColumn> {
assert!(columns.iter().all(|column| column.is_numerical()));
let coerce_to_i64: Vec<_> = columns
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably do something a little bit nicer here, and be more coupled with the writer logic?

fn acceptable_numerical_type(numerical_types: &[NumericalType]) -> NumericalType {
     let mut compatible_numerical_types = CompatibleNumericalTypes::default();
     for &typ in numerical_types {
         compatible_numerical_types.accept(typ);
     }
     numerical_types.to_numeric_type()
}


struct DynamicColummn {
    fn column_type(&self) -> ColumnType { ... }
    fn coerce(&self, column_type: ColumnType) -> Option<DynamicColumn> { ... }
}

Copy link
Contributor Author

@PSeitz PSeitz Jan 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the type is not enough, we need to know if the a i64 column could be a u64 column (!contains negative values)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good point

}
}

pub struct MapI64ToF64;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could replace those three thing by the following?
I don;'t know any trait boudnary for as.

If you want to stick to as, can you make those private to this module?
Technically these mapping are not monotonic.

pub struct Coerce<FromTyp, ToTyp>;

impl<FromTyp, ToTyp> StrictlyMonotonicFn<FromTyp, ToTyp> for MapI64ToF64 
where FromTyp: TryFrom<ToTyp>, ToTyp: TryFrom<FromTyp>
{
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe with num traits, but the use case is too small

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator

@fulmicoton fulmicoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments inline

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2023

Codecov Report

Merging #1812 (da2cd70) into main (89cec79) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1812      +/-   ##
==========================================
- Coverage   94.14%   94.12%   -0.02%     
==========================================
  Files         274      274              
  Lines       51992    51992              
==========================================
- Hits        48946    48939       -7     
- Misses       3046     3053       +7     
Impacted Files Coverage Δ
src/schema/document.rs 87.64% <0.00%> (-4.50%) ⬇️
src/schema/schema.rs 98.92% <0.00%> (+0.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@PSeitz PSeitz merged commit b31fd38 into main Jan 20, 2023
@PSeitz PSeitz deleted the use_columnar branch January 20, 2023 06:58
Hodkinson pushed a commit to Hodkinson/tantivy that referenced this pull request Jan 30, 2023
* collect columns for merge

* return column_type from, fix visibility

* fix

Co-authored-by: Paul Masurel <paul@quickwit.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants