felipecrv commented on issue #38204:
URL: https://github.com/apache/arrow/issues/38204#issuecomment-1771381667

   > Could you give an example? I'm not convinced this is a useful distinction. 
If we explicitly define a set, when would we do so other than to enumerate the 
elements which have a property?
   
   Most of predicates in `type_traits.h` are intensional: they are referring to 
the types by definitions, not by the properties that are valid about them. We 
leave it to kernel code to derive interesting properties from the spec.
   
   Example of properties:
    - Are offsets sorted?
    - Should it have length or length + 1 offsets?
    - Does it have a null bitmap that can be trusted?
    - Is the memory for the array elements allocated contiguously? If I access 
each element by string_view, can I access a sub-range simply by having a larger 
string_view?
    - Can I write to the child array in a different order I write the elements 
to the array? (this is true for fixed-size lists and list-views, but not for 
lists)
    
   This is why I would prefer to keep `type_traits.h` (the public interface) 
mostly defining sets of types by name and keep the extensional definitions that 
talk about the properties private and closer to the kernels that leverage them.
    
    


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

Reply via email to