-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat: general compression for value page buffer #2368
Conversation
ACTION NEEDED Lance follows the Conventional Commits specification for release automation. The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
async move { | ||
let bytes = bytes.await?; | ||
let data = if compressed { | ||
ValuePageScheduler::decompress_with_ranges(&bytes, &range_offsets)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if it is appropriate to handle decompression in the scheduler. However, since the compressed bytes read from disk may be reused multiple times, decompression should not occur in decode_into for optimal performance. Please advise on this. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is a bit tricky, I see your concern. Unfortunately, we really shouldn't be doing the decompression here in the scheduler. The scheduler is single threaded and by doing compression here we will fall behind in scheduling I/O.
Something simple, that should work, is to wrap the compression task in a Arc<Mutex<...>> that each of the decode tasks that need that range share. Something roughly like...
struct ValuePageDecoder {
bytes_per_value: u64,
compressed_data: Vec<Bytes>,
uncompressed_data: Arc<Mutex<Option<Bytes>>>,
}
impl ValuePageDecoder {
// Called from decode_into
fn get_uncompressed_bytes(&self) -> Result<Bytes> {
let uncompressed_bytes = self.uncompressed_data.lock().unwrap();
if uncompressed_bytes.is_none() {
*uncompressed_bytes = self.decompress()?;
}
Ok(uncompressed_bytes.clone())
}
}
This is not ideal because it means the decoder threads will be blocked for a bit but it should be good enough to start with.
A more complicated solution might be to have a dedicated thread pool for decompression. Once I/O is available we start to decompress it in this thread pool. I think we could do this as part of the I/O scheduler. So we can have arguments to submit_request
which explain that the data is compressed and includes the parameters needed to decompress it. This would mean that compression is not just an "encoding" but something more fundamental but this is probably ok. We probably also want to treat encryption similarly. It also means we lose a bit of thread locality but I think that is inevitable. Decompression / decryption is costly enough that we want to parallelize across columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something simple, that should work, is to wrap the compression task in a Arc<Mutex<...>> that each of the decode tasks that need that range share
This is not ideal because it means the decoder threads will be blocked for a bit but it should be good enough to start with.
Got it. I've considered this approach and its potential downsides. If it is deemed acceptable, I will revise the implementation accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change accordingly, and uncompressed_bytes.clone()
seems to copy the data, so I use Arc
to avoid the copy (but the lock is still hold during decode_buffer
), could you please check it out see if it fits? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for working on this. We will need to move decompression off the scheduling thread but I think we can do something simple for now and I have proposed an idea how we can handle it better in the long term.
async move { | ||
let bytes = bytes.await?; | ||
let data = if compressed { | ||
ValuePageScheduler::decompress_with_ranges(&bytes, &range_offsets)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is a bit tricky, I see your concern. Unfortunately, we really shouldn't be doing the decompression here in the scheduler. The scheduler is single threaded and by doing compression here we will fall behind in scheduling I/O.
Something simple, that should work, is to wrap the compression task in a Arc<Mutex<...>> that each of the decode tasks that need that range share. Something roughly like...
struct ValuePageDecoder {
bytes_per_value: u64,
compressed_data: Vec<Bytes>,
uncompressed_data: Arc<Mutex<Option<Bytes>>>,
}
impl ValuePageDecoder {
// Called from decode_into
fn get_uncompressed_bytes(&self) -> Result<Bytes> {
let uncompressed_bytes = self.uncompressed_data.lock().unwrap();
if uncompressed_bytes.is_none() {
*uncompressed_bytes = self.decompress()?;
}
Ok(uncompressed_bytes.clone())
}
}
This is not ideal because it means the decoder threads will be blocked for a bit but it should be good enough to start with.
A more complicated solution might be to have a dedicated thread pool for decompression. Once I/O is available we start to decompress it in this thread pool. I think we could do this as part of the I/O scheduler. So we can have arguments to submit_request
which explain that the data is compressed and includes the parameters needed to decompress it. This would mean that compression is not just an "encoding" but something more fundamental but this is probably ok. We probably also want to treat encryption similarly. It also means we lose a bit of thread locality but I think that is inevitable. Decompression / decryption is costly enough that we want to parallelize across columns.
} | ||
|
||
impl ValuePageScheduler { | ||
pub fn new(bytes_per_value: u64, buffer_offset: u64) -> Self { | ||
pub fn new(bytes_per_value: u64, buffer_offset: u64, buffer_size: u64) -> Self { | ||
let compressed = std::env::var("LANCE_COMPRESSED_PAGE").is_ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use an environment variable on the write side. However, we should not use the environment variable on the read side. I think changes to encodings.proto
are needed. For now, we can probably do this:
// Fixed width items placed contiguously in a buffer
message Flat {
// the number of bits per value, must be greater than 0, does
// not need to be a multiple of 8
uint64 bits_per_value = 1;
// the buffer of values
Buffer buffer = 2;
// The Compression message can specify the compression scheme (e.g. zstd) and any
// other information that is needed for decompression.
Compression compression = 3;
}
Later, if we end up going with the "dedicated thread pool for compression" and make compression part of the I/O scheduler then I think the Compression
message will be a part of Buffer
and not part of Flat
. However, we can tackle that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added such a structure in protobuf:
message Compression {
string scheme = 1;
}
Currently, only the name of the compression scheme is stored and retrieved. Let me know if this is okay. Thanks.
rust/lance-file/src/v2/reader.rs
Outdated
struct EnvVarGuard { | ||
key: String, | ||
original_value: Option<String>, | ||
} | ||
|
||
impl EnvVarGuard { | ||
fn new(key: &str, new_value: &str) -> Self { | ||
let original_value = std::env::var(key).ok(); | ||
std::env::set_var(key, new_value); | ||
EnvVarGuard { | ||
key: key.to_string(), | ||
original_value, | ||
} | ||
} | ||
} | ||
|
||
impl Drop for EnvVarGuard { | ||
fn drop(&mut self) { | ||
if let Some(ref value) = self.original_value { | ||
std::env::set_var(&self.key, value); | ||
} else { | ||
std::env::remove_var(&self.key); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange. I thought we had something like this in the code base already but I cannot find it now.
b8899f6
to
8e3b81d
Compare
@westonpace I updated the PR according to your review comments, could you please check it out? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for doing this. I've started moving towards "picking an encoder" in #2388 and it uses field metadata.
I've approved the tests if you want to try and look at any test failures, looks like there might be at least one format / lint issue.
Don't worry if you can't get to it by my tomorrow morning (~12 hours from now). I'll go ahead and fix anything and get this merged in at that time. I want to get this PR merged first so you don't have to deal with a rebase from #2388
…o avoid blocking scheduler.
…the name of the compression scheme instead of a boolean value.
69a275c
to
da0e46f
Compare
I've updated the code, and hope the latest commit address all the lint issues. Thanks. |
da0e46f
to
b7503b8
Compare
I have updated the code to address one remaining test issue. I ran the tests locally, but one test case reported Thanks. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2368 +/- ##
==========================================
- Coverage 79.99% 79.99% -0.01%
==========================================
Files 200 200
Lines 54519 54713 +194
Branches 54519 54713 +194
==========================================
+ Hits 43612 43766 +154
- Misses 8389 8410 +21
- Partials 2518 2537 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b7503b8
to
26ed040
Compare
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [lance](https://togithub.com/lancedb/lance) | dependencies | minor | `0.10.16` -> `0.12.0` | --- ### Release Notes <details> <summary>lancedb/lance (lance)</summary> ### [`v0.12.1`](https://togithub.com/lancedb/lance/releases/tag/v0.12.1) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.12.0...v0.12.1) <!-- Release notes generated using configuration in .github/release.yml at v0.12.1 --> #### What's Changed ##### Bug Fixes 🐛 - fix: incorrect chunking was making lance datasets use too much RAM by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2438](https://togithub.com/lancedb/lance/pull/2438) **Full Changelog**: lancedb/lance@v0.12.0...v0.12.1 ### [`v0.12.0`](https://togithub.com/lancedb/lance/releases/tag/v0.12.0) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.11.1...v0.12.0) <!-- Release notes generated using configuration in .github/release.yml at v0.12.0 --> #### What's Changed ##### Breaking Changes 🛠 - feat: change dataset uri to return full qualified url instead of object store path by [@​eddyxu](https://togithub.com/eddyxu) in [https://github.com/lancedb/lance/pull/2416](https://togithub.com/lancedb/lance/pull/2416) ##### New Features 🎉 - feat: new shuffler by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2404](https://togithub.com/lancedb/lance/pull/2404) - feat: new index builder by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2401](https://togithub.com/lancedb/lance/pull/2401) - feat: stable row id manifest changes by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2363](https://togithub.com/lancedb/lance/pull/2363) - feat: once a table has been created with v1 or v2 format then it should always use that format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2435](https://togithub.com/lancedb/lance/pull/2435) ##### Bug Fixes 🐛 - fix: fix file writer which was not writing page buffers in the correct order by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2413](https://togithub.com/lancedb/lance/pull/2413) ##### Other Changes - refactor: refactor logical decoders into "field decoders" by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2407](https://togithub.com/lancedb/lance/pull/2407) - refactor: rename use_experimental_writer to use_legacy_format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2433](https://togithub.com/lancedb/lance/pull/2433) - refactor: minor refactor to allow I/O scheduler to be cloned in page schedulers by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2432](https://togithub.com/lancedb/lance/pull/2432) **Full Changelog**: lancedb/lance@v0.11.1...v0.12.0 ### [`v0.11.1`](https://togithub.com/lancedb/lance/releases/tag/v0.11.1) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.11.0...v0.11.1) <!-- Release notes generated using configuration in .github/release.yml at v0.11.1 --> #### What's Changed ##### New Features 🎉 - feat(java): support jdk8 by [@​LuQQiu](https://togithub.com/LuQQiu) in [https://github.com/lancedb/lance/pull/2362](https://togithub.com/lancedb/lance/pull/2362) - feat: support kmode with hamming distance by [@​eddyxu](https://togithub.com/eddyxu) in [https://github.com/lancedb/lance/pull/2366](https://togithub.com/lancedb/lance/pull/2366) - feat: row id index structures (experimental) by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2303](https://togithub.com/lancedb/lance/pull/2303) - feat: update merge_insert to add statistics for inserted, updated, deleted rows by [@​raunaks13](https://togithub.com/raunaks13) in [https://github.com/lancedb/lance/pull/2357](https://togithub.com/lancedb/lance/pull/2357) - feat: define Flat index as a scan over VectorStorage by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2380](https://togithub.com/lancedb/lance/pull/2380) - feat: add some schema utility methods to the v2 reader/writer by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2389](https://togithub.com/lancedb/lance/pull/2389) - feat: general compression for value page buffer by [@​niyue](https://togithub.com/niyue) in [https://github.com/lancedb/lance/pull/2368](https://togithub.com/lancedb/lance/pull/2368) - feat: make the index cache size (in bytes) available by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2381](https://togithub.com/lancedb/lance/pull/2381) - feat: add special uri scheme to use CloudFileReader for local fs by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2402](https://togithub.com/lancedb/lance/pull/2402) - feat: add encoder utilities for pushdown by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2388](https://togithub.com/lancedb/lance/pull/2388) ##### Bug Fixes 🐛 - fix: concat batches before writing to avoid small IO slow down by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2384](https://togithub.com/lancedb/lance/pull/2384) - fix: low recall if the num partitions is more than num rows by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2386](https://togithub.com/lancedb/lance/pull/2386) - fix: f32 reduce_min for x86 by [@​heiher](https://togithub.com/heiher) in [https://github.com/lancedb/lance/pull/2385](https://togithub.com/lancedb/lance/pull/2385) - fix: fix incorrect validation logic in updater by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2408](https://togithub.com/lancedb/lance/pull/2408) ##### Performance Improvements 🚀 - perf: make VectorStorage and DistCalculator static to generate better code by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2355](https://togithub.com/lancedb/lance/pull/2355) - perf: optimize IO path for reading manifest by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2396](https://togithub.com/lancedb/lance/pull/2396) ##### Other Changes - refactor: make proto conversion fallible and not copy by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2371](https://togithub.com/lancedb/lance/pull/2371) - refactor: separate take and schema evolution impls to own files by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2372](https://togithub.com/lancedb/lance/pull/2372) - Revert "fix: concat batches before writing to avoid small IO slow down ([#​2384](https://togithub.com/lancedb/lance/issues/2384))" by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2387](https://togithub.com/lancedb/lance/pull/2387) - refactor: shuffle around v2 metadata sections to allow read-on-demand statistics by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2400](https://togithub.com/lancedb/lance/pull/2400) #### New Contributors - [@​niyue](https://togithub.com/niyue) made their first contribution in [https://github.com/lancedb/lance/pull/2368](https://togithub.com/lancedb/lance/pull/2368) - [@​heiher](https://togithub.com/heiher) made their first contribution in [https://github.com/lancedb/lance/pull/2385](https://togithub.com/lancedb/lance/pull/2385) **Full Changelog**: lancedb/lance@v0.11.0...v0.11.1 ### [`v0.11.0`](https://togithub.com/lancedb/lance/releases/tag/v0.11.0) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.10.18...v0.11.0) <!-- Release notes generated using configuration in .github/release.yml at v0.11.0 --> #### What's Changed ##### Breaking Changes 🛠 - feat(rust)!: use BoxedError in Error::IO by [@​broccoliSpicy](https://togithub.com/broccoliSpicy) in [https://github.com/lancedb/lance/pull/2329](https://togithub.com/lancedb/lance/pull/2329) ##### New Features 🎉 - feat: add v2 support to fragment merge / update paths by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2311](https://togithub.com/lancedb/lance/pull/2311) - feat: add priority to I/O scheduler by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2315](https://togithub.com/lancedb/lance/pull/2315) - feat: add take_rows operation to the v2 file reader's python bindings by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2331](https://togithub.com/lancedb/lance/pull/2331) - feat: added example for reading and writing dataset in rust by [@​raunaks13](https://togithub.com/raunaks13) in [https://github.com/lancedb/lance/pull/2349](https://togithub.com/lancedb/lance/pull/2349) - feat: new HNSW implementation by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2353](https://togithub.com/lancedb/lance/pull/2353) - feat: add fragment take / fixed-size-binary support to v2 format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2354](https://togithub.com/lancedb/lance/pull/2354) ##### Bug Fixes 🐛 - fix: recognize a simple expression like 'is_foo' as a scalar index query by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2356](https://togithub.com/lancedb/lance/pull/2356) - fix: rework list encoder to handle list-struct by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2344](https://togithub.com/lancedb/lance/pull/2344) - fix: minor bug fixes for v2 by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2361](https://togithub.com/lancedb/lance/pull/2361) ##### Documentation 📚 - docs: clearify comments in table.proto -> message DataFragment -> physical_rows by [@​broccoliSpicy](https://togithub.com/broccoliSpicy) in [https://github.com/lancedb/lance/pull/2346](https://togithub.com/lancedb/lance/pull/2346) ##### Performance Improvements 🚀 - perf: use the file metadata cache in scalar indices by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2330](https://togithub.com/lancedb/lance/pull/2330) ##### Other Changes - chore: remove `m_max` and `use_heuristic` params from HNSW builder by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2336](https://togithub.com/lancedb/lance/pull/2336) - fix(java): fix JNI jar loader issue by [@​LuQQiu](https://togithub.com/LuQQiu) in [https://github.com/lancedb/lance/pull/2340](https://togithub.com/lancedb/lance/pull/2340) - ci: fix labeler permissions by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2348](https://togithub.com/lancedb/lance/pull/2348) - fix: rework decoding to fix bugs in nested struct decoding by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2337](https://togithub.com/lancedb/lance/pull/2337) #### New Contributors - [@​broccoliSpicy](https://togithub.com/broccoliSpicy) made their first contribution in [https://github.com/lancedb/lance/pull/2346](https://togithub.com/lancedb/lance/pull/2346) - [@​raunaks13](https://togithub.com/raunaks13) made their first contribution in [https://github.com/lancedb/lance/pull/2349](https://togithub.com/lancedb/lance/pull/2349) **Full Changelog**: lancedb/lance@v0.10.18...v0.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/spiraldb/vortex). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [lance](https://togithub.com/lancedb/lance) | dependencies | minor | `0.10.16` -> `0.12.0` | --- ### Release Notes <details> <summary>lancedb/lance (lance)</summary> ### [`v0.12.1`](https://togithub.com/lancedb/lance/releases/tag/v0.12.1) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.12.0...v0.12.1) <!-- Release notes generated using configuration in .github/release.yml at v0.12.1 --> #### What's Changed ##### Bug Fixes 🐛 - fix: incorrect chunking was making lance datasets use too much RAM by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2438](https://togithub.com/lancedb/lance/pull/2438) **Full Changelog**: lancedb/lance@v0.12.0...v0.12.1 ### [`v0.12.0`](https://togithub.com/lancedb/lance/releases/tag/v0.12.0) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.11.1...v0.12.0) <!-- Release notes generated using configuration in .github/release.yml at v0.12.0 --> #### What's Changed ##### Breaking Changes 🛠 - feat: change dataset uri to return full qualified url instead of object store path by [@​eddyxu](https://togithub.com/eddyxu) in [https://github.com/lancedb/lance/pull/2416](https://togithub.com/lancedb/lance/pull/2416) ##### New Features 🎉 - feat: new shuffler by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2404](https://togithub.com/lancedb/lance/pull/2404) - feat: new index builder by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2401](https://togithub.com/lancedb/lance/pull/2401) - feat: stable row id manifest changes by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2363](https://togithub.com/lancedb/lance/pull/2363) - feat: once a table has been created with v1 or v2 format then it should always use that format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2435](https://togithub.com/lancedb/lance/pull/2435) ##### Bug Fixes 🐛 - fix: fix file writer which was not writing page buffers in the correct order by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2413](https://togithub.com/lancedb/lance/pull/2413) ##### Other Changes - refactor: refactor logical decoders into "field decoders" by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2407](https://togithub.com/lancedb/lance/pull/2407) - refactor: rename use_experimental_writer to use_legacy_format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2433](https://togithub.com/lancedb/lance/pull/2433) - refactor: minor refactor to allow I/O scheduler to be cloned in page schedulers by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2432](https://togithub.com/lancedb/lance/pull/2432) **Full Changelog**: lancedb/lance@v0.11.1...v0.12.0 ### [`v0.11.1`](https://togithub.com/lancedb/lance/releases/tag/v0.11.1) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.11.0...v0.11.1) <!-- Release notes generated using configuration in .github/release.yml at v0.11.1 --> #### What's Changed ##### New Features 🎉 - feat(java): support jdk8 by [@​LuQQiu](https://togithub.com/LuQQiu) in [https://github.com/lancedb/lance/pull/2362](https://togithub.com/lancedb/lance/pull/2362) - feat: support kmode with hamming distance by [@​eddyxu](https://togithub.com/eddyxu) in [https://github.com/lancedb/lance/pull/2366](https://togithub.com/lancedb/lance/pull/2366) - feat: row id index structures (experimental) by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2303](https://togithub.com/lancedb/lance/pull/2303) - feat: update merge_insert to add statistics for inserted, updated, deleted rows by [@​raunaks13](https://togithub.com/raunaks13) in [https://github.com/lancedb/lance/pull/2357](https://togithub.com/lancedb/lance/pull/2357) - feat: define Flat index as a scan over VectorStorage by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2380](https://togithub.com/lancedb/lance/pull/2380) - feat: add some schema utility methods to the v2 reader/writer by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2389](https://togithub.com/lancedb/lance/pull/2389) - feat: general compression for value page buffer by [@​niyue](https://togithub.com/niyue) in [https://github.com/lancedb/lance/pull/2368](https://togithub.com/lancedb/lance/pull/2368) - feat: make the index cache size (in bytes) available by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2381](https://togithub.com/lancedb/lance/pull/2381) - feat: add special uri scheme to use CloudFileReader for local fs by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2402](https://togithub.com/lancedb/lance/pull/2402) - feat: add encoder utilities for pushdown by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2388](https://togithub.com/lancedb/lance/pull/2388) ##### Bug Fixes 🐛 - fix: concat batches before writing to avoid small IO slow down by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2384](https://togithub.com/lancedb/lance/pull/2384) - fix: low recall if the num partitions is more than num rows by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2386](https://togithub.com/lancedb/lance/pull/2386) - fix: f32 reduce_min for x86 by [@​heiher](https://togithub.com/heiher) in [https://github.com/lancedb/lance/pull/2385](https://togithub.com/lancedb/lance/pull/2385) - fix: fix incorrect validation logic in updater by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2408](https://togithub.com/lancedb/lance/pull/2408) ##### Performance Improvements 🚀 - perf: make VectorStorage and DistCalculator static to generate better code by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2355](https://togithub.com/lancedb/lance/pull/2355) - perf: optimize IO path for reading manifest by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2396](https://togithub.com/lancedb/lance/pull/2396) ##### Other Changes - refactor: make proto conversion fallible and not copy by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2371](https://togithub.com/lancedb/lance/pull/2371) - refactor: separate take and schema evolution impls to own files by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2372](https://togithub.com/lancedb/lance/pull/2372) - Revert "fix: concat batches before writing to avoid small IO slow down ([#​2384](https://togithub.com/lancedb/lance/issues/2384))" by [@​chebbyChefNEQ](https://togithub.com/chebbyChefNEQ) in [https://github.com/lancedb/lance/pull/2387](https://togithub.com/lancedb/lance/pull/2387) - refactor: shuffle around v2 metadata sections to allow read-on-demand statistics by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2400](https://togithub.com/lancedb/lance/pull/2400) #### New Contributors - [@​niyue](https://togithub.com/niyue) made their first contribution in [https://github.com/lancedb/lance/pull/2368](https://togithub.com/lancedb/lance/pull/2368) - [@​heiher](https://togithub.com/heiher) made their first contribution in [https://github.com/lancedb/lance/pull/2385](https://togithub.com/lancedb/lance/pull/2385) **Full Changelog**: lancedb/lance@v0.11.0...v0.11.1 ### [`v0.11.0`](https://togithub.com/lancedb/lance/releases/tag/v0.11.0) [Compare Source](https://togithub.com/lancedb/lance/compare/v0.10.18...v0.11.0) <!-- Release notes generated using configuration in .github/release.yml at v0.11.0 --> #### What's Changed ##### Breaking Changes 🛠 - feat(rust)!: use BoxedError in Error::IO by [@​broccoliSpicy](https://togithub.com/broccoliSpicy) in [https://github.com/lancedb/lance/pull/2329](https://togithub.com/lancedb/lance/pull/2329) ##### New Features 🎉 - feat: add v2 support to fragment merge / update paths by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2311](https://togithub.com/lancedb/lance/pull/2311) - feat: add priority to I/O scheduler by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2315](https://togithub.com/lancedb/lance/pull/2315) - feat: add take_rows operation to the v2 file reader's python bindings by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2331](https://togithub.com/lancedb/lance/pull/2331) - feat: added example for reading and writing dataset in rust by [@​raunaks13](https://togithub.com/raunaks13) in [https://github.com/lancedb/lance/pull/2349](https://togithub.com/lancedb/lance/pull/2349) - feat: new HNSW implementation by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2353](https://togithub.com/lancedb/lance/pull/2353) - feat: add fragment take / fixed-size-binary support to v2 format by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2354](https://togithub.com/lancedb/lance/pull/2354) ##### Bug Fixes 🐛 - fix: recognize a simple expression like 'is_foo' as a scalar index query by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2356](https://togithub.com/lancedb/lance/pull/2356) - fix: rework list encoder to handle list-struct by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2344](https://togithub.com/lancedb/lance/pull/2344) - fix: minor bug fixes for v2 by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2361](https://togithub.com/lancedb/lance/pull/2361) ##### Documentation 📚 - docs: clearify comments in table.proto -> message DataFragment -> physical_rows by [@​broccoliSpicy](https://togithub.com/broccoliSpicy) in [https://github.com/lancedb/lance/pull/2346](https://togithub.com/lancedb/lance/pull/2346) ##### Performance Improvements 🚀 - perf: use the file metadata cache in scalar indices by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2330](https://togithub.com/lancedb/lance/pull/2330) ##### Other Changes - chore: remove `m_max` and `use_heuristic` params from HNSW builder by [@​BubbleCal](https://togithub.com/BubbleCal) in [https://github.com/lancedb/lance/pull/2336](https://togithub.com/lancedb/lance/pull/2336) - fix(java): fix JNI jar loader issue by [@​LuQQiu](https://togithub.com/LuQQiu) in [https://github.com/lancedb/lance/pull/2340](https://togithub.com/lancedb/lance/pull/2340) - ci: fix labeler permissions by [@​wjones127](https://togithub.com/wjones127) in [https://github.com/lancedb/lance/pull/2348](https://togithub.com/lancedb/lance/pull/2348) - fix: rework decoding to fix bugs in nested struct decoding by [@​westonpace](https://togithub.com/westonpace) in [https://github.com/lancedb/lance/pull/2337](https://togithub.com/lancedb/lance/pull/2337) #### New Contributors - [@​broccoliSpicy](https://togithub.com/broccoliSpicy) made their first contribution in [https://github.com/lancedb/lance/pull/2346](https://togithub.com/lancedb/lance/pull/2346) - [@​raunaks13](https://togithub.com/raunaks13) made their first contribution in [https://github.com/lancedb/lance/pull/2349](https://togithub.com/lancedb/lance/pull/2349) **Full Changelog**: lancedb/lance@v0.10.18...v0.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/spiraldb/vortex). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR introduces general compression for value page buffers, starting with zstd, to reduce the on-disk size of all types of value arrays.
Here are the key details:
ValueEncoder
instead of as an independent physical encoder. Please let me know if this approach is suitable.ValuePageScheduler.schedule_ranges
allow it to read the entire buffer range for compressed buffers. To support this, I added a newbuffer_size
metadata to several buffer structs, populating these variables using metadata from Lance.