Merged
Conversation
teh-cmc
commented
Dec 26, 2022
This reverts commit f802ff5.
jleibs
approved these changes
Dec 31, 2022
Contributor
jleibs
left a comment
There was a problem hiding this comment.
Very helpful way to view the data for debugging.
Comment on lines
+144
to
+163
| let comp_values: Vec<_> = comp_rows | ||
| .into_iter() | ||
| .map(|row| row.unwrap_or_else(|| new_empty_array(comp_table.datatype.clone()))) | ||
| .collect(); | ||
| let comp_values: Vec<_> = comp_values.iter().map(|arr| &**arr).collect(); | ||
|
|
||
| // Each cell is actually a list, so we need to compute offsets one cell at a time. | ||
| let mut offset = 0i32; | ||
| let comp_offsets: Vec<_> = comp_values | ||
| .iter() | ||
| .map(|row| { | ||
| let ret = offset; | ||
| offset += row.len() as i32; | ||
| ret | ||
| }) | ||
| // don't forget the last element! | ||
| .chain(std::iter::once( | ||
| comp_values.iter().map(|row| row.len() as i32).sum(), | ||
| )) | ||
| .collect(); |
Contributor
There was a problem hiding this comment.
The empty arrays don't actually need to be created since they take up zero space in the value-array -- you just need to book-keep them in the offset array.
Suggested change
| let comp_values: Vec<_> = comp_rows | |
| .into_iter() | |
| .map(|row| row.unwrap_or_else(|| new_empty_array(comp_table.datatype.clone()))) | |
| .collect(); | |
| let comp_values: Vec<_> = comp_values.iter().map(|arr| &**arr).collect(); | |
| // Each cell is actually a list, so we need to compute offsets one cell at a time. | |
| let mut offset = 0i32; | |
| let comp_offsets: Vec<_> = comp_values | |
| .iter() | |
| .map(|row| { | |
| let ret = offset; | |
| offset += row.len() as i32; | |
| ret | |
| }) | |
| // don't forget the last element! | |
| .chain(std::iter::once( | |
| comp_values.iter().map(|row| row.len() as i32).sum(), | |
| )) | |
| .collect(); | |
| // Each cell is actually a list, so we need to compute offsets one cell at a time. | |
| let mut offset = 0i32; | |
| let comp_offsets: Vec<_> = std::iter::once(0) | |
| .chain(comp_rows.iter().map(|row| { | |
| offset += row.as_ref().map_or(0, |row| row.len()) as i32; | |
| offset | |
| })) | |
| .collect(); | |
| let comp_values: Vec<_> = comp_rows.iter().flatten().map(|row| row.as_ref()).collect(); |
Contributor
Author
There was a problem hiding this comment.
jesus, nevermind the empty arrays, none of that code made any sense 😂
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #640
Requires #609 (to keep things linear, don't want to have to deal with a multiverse situation...)
This also adds a new datastore config:
store_insert_ids.When enabled (default in debug), the ID of a write request will be stored alongside the data that was written.
This replaces the doc-comment-examples of all dataframe APIs with actual standalone examples.
Example:
Outputs:
