Skip to content

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 2, 2025

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

Basically, I was confused about the casting / conversion functions available so I want to improve the documentation

What changes are included in this PR?

  1. Add documentation, improve other docs
  2. Remove pub crates in favor of exporting only the functions/ structs needed

Are these changes tested?

Yes by CI
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.

@github-actions github-actions bot added parquet Changes to the parquet crate parquet-variant parquet-variant* crates labels Oct 2, 2025
use parquet_variant::{Variant, VariantBuilder};
use parquet_variant_compute::variant_get::{variant_get, GetOptions};
use parquet_variant_compute::{json_to_variant, VariantArray, VariantArrayBuilder};
use parquet_variant_compute::{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved all the functions into the main parquet_variant_compute module

/// # use arrow::array::{Array, ArrayRef, Int64Array};
/// # use parquet_variant::Variant;
/// # use parquet_variant_compute::cast_to_variant::cast_to_variant;
/// # use parquet_variant_compute::cast_to_variant;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise, I removed this extra level of namespacing

//! * [`VariantType`] Arrow ExtensionType for Parquet Variant logical type.
//! [`variant_get`] to extracting a value by path and functions to convert
//! between `Variant` and JSON.
//! * Representation of [`Variant`], and [`VariantArray`] for working with
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was largely a copy of what was in parquet_variant and parquet_variant_compute so I changed the docs to highlight the most important functions and structures and link to the rest of the docs

@alamb alamb requested a review from Copilot October 2, 2025 11:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves documentation for the Variant feature in parquet-rs and makes kernel exports more consistent by reducing public module visibility while maintaining access to necessary functions.

  • Refactored documentation to better describe features and kernels available for Variant operations
  • Made internal modules private and exposed only the required functions through the main module interface
  • Updated import paths in examples and benchmarks to reflect the new module structure

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
parquet/src/variant.rs Updated module-level documentation to better describe Variant features and refer to sub-modules
parquet-variant-compute/src/lib.rs Improved documentation structure, made modules private, and exported specific functions
parquet-variant-compute/src/cast_to_variant.rs Updated example import path to use function directly instead of module path
parquet-variant-compute/benches/variant_kernels.rs Consolidated imports to use functions from main module instead of sub-modules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@mbrobbel mbrobbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alamb

@alamb
Copy link
Contributor Author

alamb commented Oct 3, 2025

Thanks for the review @mbrobbel

@scovich are you interested in reviewing this PR as well?

Copy link
Contributor

@scovich scovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alamb alamb merged commit 43c84fc into apache:main Oct 4, 2025
19 checks passed
@alamb alamb deleted the alamb/unified_interface_comments branch October 4, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate parquet-variant parquet-variant* crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Variant] casting functions are confusingly named
3 participants