wgtmac commented on code in PR #207:
URL: https://github.com/apache/iceberg-cpp/pull/207#discussion_r2328754245
##########
src/iceberg/schema.h:
##########
@@ -65,18 +66,110 @@ class ICEBERG_EXPORT Schema : public StructType {
/// canonical name 'm.value.x'
/// FIXME: Currently only handles ASCII lowercase conversion; extend to
support
/// non-ASCII characters (e.g., using std::towlower or ICU)
- [[nodiscard]] Result<std::optional<std::reference_wrapper<const
SchemaField>>>
- FindFieldByName(std::string_view name, bool case_sensitive = true) const;
+ Result<std::optional<std::reference_wrapper<const SchemaField>>>
FindFieldByName(
+ std::string_view name, bool case_sensitive = true) const;
/// \brief Find the SchemaField by field id.
- [[nodiscard]] Result<std::optional<std::reference_wrapper<const
SchemaField>>>
- FindFieldById(int32_t field_id) const;
+ Result<std::optional<std::reference_wrapper<const SchemaField>>>
FindFieldById(
+ int32_t field_id) const;
+
+ /// \brief Creates a projected schema from selected field names.
+ ///
+ /// Selects fields by their names using dot notation for nested fields.
+ /// Supports both canonical names (e.g., "user.address.street") and short
names
+ /// (e.g., "user.street" for map values, "list.element" for list elements).
+ ///
+ /// \param names Field names to select (supports nested field paths)
+ /// \param case_sensitive Whether name matching is case-sensitive (default:
true)
+ /// \return Projected schema containing only the specified fields
+ ///
+ /// \example
Review Comment:
The comments here and below are a little bit over-complicated. I think we
can remove the concrete examples if the parameter docstrings are clear enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]