-
Notifications
You must be signed in to change notification settings - Fork 1k
General virtual columns support + row numbers as a first use-case #8715
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: scovich <[email protected]>
…eature tests pass
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| use arrow_schema::{DataType, Field, Fields, SchemaBuilder}; |
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.
shouldn't move this
| #[cfg(test)] | ||
| mod test_util; | ||
|
|
||
| // Note that this crate is public under the `experimental` feature flag. |
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.
shouldn't remove this comment
| } | ||
|
|
||
| fn skip_records(&mut self, num_records: usize) -> Result<usize> { | ||
| // TODO: Use advance_by when it stabilizes to improve performance |
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.
TODO from original PR
| #[cfg(feature = "encryption")] | ||
| pub(crate) file_decryption_properties: Option<Arc<FileDecryptionProperties>>, | ||
|
|
||
| virtual_columns: Vec<Field> |
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.
maybe it should be Vec<&Field>
| /// let virtual_columns = vec![Field::new("row_number", ArrowDataType::Int64, false).with_extension_type(RowNumber)]; | ||
| /// let options = ArrowReaderOptions::new().with_virtual_columns(virtual_columns); | ||
| pub fn with_virtual_columns(self, virtual_columns: Vec<Field>) -> Self { | ||
| // TODO @vustef: Make sure the passed fields are virtual 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.
I still have a bunch of TODOs to address
| } | ||
|
|
||
| fn row_groups(&self) -> Box<dyn Iterator<Item = &RowGroupMetaData> + '_> { | ||
| Box::new(std::iter::once(self.metadata.row_group(self.row_group_idx))) |
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 duplicates a lot, not sure if anything can be done here
| /// - If nullable: def_level = parent_def_level + 1 | ||
| /// - If required: def_level = parent_def_level | ||
| /// - rep_level = parent_rep_level (virtual fields are not repeated) | ||
| fn convert_virtual_field( |
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.
the name used here is not aligned with what other convert_ functions do
…hen metadata parsing may skip row groups
Based on #7307.
Which issue does this PR close?
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
Rationale for this change
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
What changes are included in this PR?
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
Are these changes tested?
We typically require tests for all PRs in order to:
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
Are there any user-facing changes?
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.