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

No need construct def_level_decoder and rep_level_decoder in each page. #2171

Closed
Ted-Jiang opened this issue Jul 26, 2022 · 4 comments
Closed
Labels
development-process Related to development process of arrow-rs

Comments

@Ted-Jiang
Copy link
Member

/// Set the current page reader.
pub fn set_page_reader(&mut self, page_reader: Box<dyn PageReader>) -> Result<()> {
let descr = &self.column_desc;
let values_decoder = CV::new(descr);
let def_level_decoder = (descr.max_def_level() != 0).then(|| {
DefinitionLevelBufferDecoder::new(
descr.max_def_level(),
packed_null_mask(descr),
)
});
let rep_level_decoder = (descr.max_rep_level() != 0)
.then(|| ColumnLevelDecoderImpl::new(descr.max_rep_level()));
self.column_reader = Some(GenericColumnReader::new_with_decoders(
self.column_desc.clone(),
page_reader,
values_decoder,
def_level_decoder,
rep_level_decoder,
));
Ok(())
}

def_level_decoder and rep_level_decoder are base one the the column_desc (column chunk level). No need to create them in each page.

@Ted-Jiang
Copy link
Member Author

@tustvold we can create it when new ColChunk, am i right?

@tustvold
Copy link
Contributor

tustvold commented Jul 26, 2022

PageReader is an iterator of Page within a ColumnChunk, so they are being created once for each column chunk.

Theoretically we could create them once per file, in practice I wouldn't expect it to make a difference. The columns chunks should be large enough that any overhead will be amortised to insignificance...

@tustvold
Copy link
Contributor

Can this be closed?

@Ted-Jiang
Copy link
Member Author

Sure

@tustvold tustvold closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@tustvold tustvold added the development-process Related to development process of arrow-rs label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development-process Related to development process of arrow-rs
Projects
None yet
Development

No branches or pull requests

2 participants