Open ngli-me opened 1 month ago
Another alternative might be a manual implementation PartialOrd for DFSchemaRef perhaps based on field names or something
Another solution would be to use something like the derivative crate, but that means another attribute for the struct, and additional attributes for the fields being excluded.
It also means another dependency which would be nice to avoid if possible
Is your feature request related to a problem or challenge?
_Originally posted by @alamb in https://github.com/apache/datafusion/pull/12481#discussion_r1761693610_
12481 gives a possible implementation for PartialOrd, using a mix of manual implementations and derivations. The main blocker on using only derivations is
DFSchemaRef
, which is an incomparable type, along with the associatedSchema
, and minorlyHashMap
.Describe the solution you'd like
There are a couple of possible solutions. One simple one might be to just give a manual implementation of
PartialOrd
forDFSchemaRef
that just returnsNone
, allowing for types using it to derivePartialOrd
. However, this would still leave a gap for the other datatypes used.Describe alternatives you've considered
Another solution would be to use something like the derivative crate, but that means another attribute for the struct, and additional attributes for the fields being excluded.
The current alternate solution being used for structs with >3 fields in #12481 is to have a inner struct for the
PartialOrd
manual implementation, that excludes in incomparable fields. This is easier to maintain, but also has a few drawbacks.Additional context
Relevant: #8932.