Repository navigation
Commit 2567a32
[Variant] Fix the variant shred logic (apache#10157)
# 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.
-->
- Closes apache#10145.
# 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.
-->
- Seperate the logic for `variant_shred` and `variant_get` by introduce
`shred` flag for row builder
- Move some logic in `Variant::as_xxx` to `type_conversion`, and these
moved code will be used when `variant_get`, `variant_shred` will use
`Variant::as_xxx`
- After the change, when shredding a variant, all `Variant::as_xx()` is
identity function now, `Variant::Int8` can only be treated as `int8`,
but not `int16`/`int32`/`int64`, etc.
- Removed the `Variant::as_f16`
- Add a test to cover that shred can/can't be shredded to some datatype
in `test_variant_type_shredded_correctly`
# Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->
Yes, added some tests to cover the logic
# 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.
-->
Yes, some `Variant::as_xx` logic have been changed.
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: Kosta Tarasov <33369833+sdf-jkl@users.noreply.github.com>1 parent 3e6bd62 commit 2567a32
9 files changed
Lines changed: 1606 additions & 684 deletions
File tree
- parquet-variant-compute
- src
- parquet-variant
- src
- variant
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments