Skip to content

Conversation

wgtmac
Copy link
Member

@wgtmac wgtmac commented Aug 16, 2025

  • Add StructLike, MapLike, and ArrayLike interfaces
  • Add wrapper for ManifestFile and ArrowArray

@wgtmac wgtmac force-pushed the struct_like branch 3 times, most recently from 472f2b9 to 60b93f8 Compare August 20, 2025 06:16
@wgtmac wgtmac marked this pull request as ready for review August 20, 2025 06:17
@wgtmac wgtmac force-pushed the struct_like branch 4 times, most recently from 86abc4b to 627093a Compare August 20, 2025 10:08
- Add StructLike, MapLike, and ArrayLike interfaces
- Add wrapper for ManifestFile and ArrowArray
@@ -567,4 +567,11 @@ Result<std::vector<ManifestFile>> ManifestListReaderImpl::Files() const {
return manifest_files;
}

Result<ManifestFileField> ManifestFileFieldFromIndex(int32_t index) {
if (index >= 0 && index < static_cast<int32_t>(ManifestFileField::kNextId)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to standardize the code format using index >= static_cast<int32_t>(ManifestFileField::kManifestPath) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Why? The 1st value is always at index 0 regardless of its name. Perhaps kNextId is confusing.

@wgtmac
Copy link
Member Author

wgtmac commented Aug 23, 2025

@dongxiao1198 @mapleFU @zhjwpku @lidavidm Could you please take a look?

Comment on lines 48 to 49
std::string_view, // for non-owned string, binary and fixed
std::shared_ptr<StructLike>, // for struct
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit confusing, if we want ownership, it might be:

Scalar = variant<Literal, std::shared_ptr<StructLike>, ...>

If we don't want ownership, it would be:

<...
  std::string_view,
  const StructLike*,
  const ArrayLike*,
  ...
>

Mixing string_view and sptr is so weird...

Copy link
Member

Choose a reason for hiding this comment

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

And scalar seems re-invent some member in literal?

Copy link
Member Author

@wgtmac wgtmac Aug 23, 2025

Choose a reason for hiding this comment

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

These structures are all views. I don't want any ownership for string/binary/fixed/uuid, so use std::string_view and do not reuse Literal. But we need ownership for nested struct/map/list views, so sptr is used.

/// Wrapper classes for manifest-related data structures that implement
/// StructLike, ArrayLike, and MapLike interfaces for unified data access.

#include <functional>
Copy link
Member

Choose a reason for hiding this comment

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

Why this is included?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because std::reference_wrapper is used in the header file.

@Fokko Fokko self-requested a review August 26, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants