gty404 commented on code in PR #486:
URL: https://github.com/apache/iceberg-cpp/pull/486#discussion_r2663986439


##########
src/iceberg/util/visit_type.h:
##########
@@ -124,4 +124,40 @@ inline Status VisitTypeIdInline(TypeId id, VISITOR* 
visitor, ARGS&&... args) {
 
 #undef TYPE_ID_VISIT_INLINE
 
+/// \brief Visit a type using a schema visitor pattern
+///
+/// This function provides a simplified visitor interface that groups Iceberg 
types into
+/// four categories based on their structural properties:
+///
+/// - **Struct types**: Complex types with named fields (StructType)
+/// - **List types**: Sequential container types (ListType)
+/// - **Map types**: Key-value container types (MapType)
+/// - **Primitive types**: All leaf types without nested structure (14 
primitive types)
+///
+/// This grouping is useful for algorithms that need to distinguish between 
container
+/// types and leaf types, but don't require separate handling for each 
primitive type
+/// variant (e.g., Int vs Long vs String).
+///
+/// \tparam VISITOR Visitor class that must implement four Visit methods:
+///   - `VisitStruct(const StructType&, ARGS...)` for struct types
+///   - `VisitList(const ListType&, ARGS...)` for list types
+///   - `VisitMap(const MapType&, ARGS...)` for map types
+///   - `VisitPrimitive(const PrimitiveType&, ARGS...)` for all primitive types
+/// \tparam ARGS Additional argument types forwarded to Visit methods
+/// \param type The type to visit
+/// \param visitor Pointer to the visitor instance
+/// \param args Additional arguments forwarded to the Visit methods
+/// \return The return value from the invoked Visit method
+template <typename VISITOR, typename... ARGS>
+inline auto VisitSchemaInline(const Type& type, VISITOR* visitor, ARGS&&... 
args) {

Review Comment:
   how abort  VisitTypeCategory ?



-- 
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]

Reply via email to