You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a way to compare datatype for "semantic compatibility / equality" #3199
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In apache/datafusion#4346 from DataFusion, we have a check that between each optimization pass the schema hasn't changed (see apache/datafusion#4233 by @jackwener).
However it turns out that some passes may change the metadata or nullability for a plan which is ok, but this causes the schema equality check to fail incorrectly
Describe the solution you'd like
I would like a function that does "semanic equality" checking of a datatype -- specifically one that ignores any metadata or nullability information and only compares:
field_name
data_type
Describe alternatives you've considered
We can keep the code entirely in datafusion -- see initial implementation in apache/datafusion#4347
though arrow-cmp is mostly about comparing data -- I don't think it is really for comparing scheams
Probably arrow-schema is best
@alamb is there any interest to place this logic in arrow-rs still or should we close this issues?
I think it would only make sense to put in arrow-rs if there are other users other than DataFUsion that would use it
Since what "semantically compatible" means may be pretty specific to each use case, I am not sure how much value moving the code to arrow-rs would bring
Since what "semantically compatible" means may be pretty specific to each use case, I am not sure how much value moving the code to arrow-rs would bring
I was thinking of introducing an enum/struct that would serve as a gauge for how in-depth the comparison would be:
Since what "semantically compatible" means may be pretty specific to each use case, I am not sure how much value moving the code to arrow-rs would bring
I was thinking of introducing an enum/struct that would serve as a gauge for how in-depth the comparison would be:
Activity
tustvold commentedon Nov 26, 2022
Perhaps we could modify https://docs.rs/arrow-schema/27.0.0/arrow_schema/enum.DataType.html#method.equals_datatype to not take account of nullability?
alamb commentedon Nov 27, 2022
that sounds good to me
Rich-T-kid commentedon Aug 25, 2026
take
Rich-T-kid commentedon Aug 27, 2026
seems like
arrow-cmpwould be a nice destination for this functionRich-T-kid commentedon Aug 27, 2026
actually it seems like this was implemented in datafusion apache/datafusion#4347
@alamb is there any interest to place this logic in arrow-rs still or should we close this issues?
alamb commentedon Aug 27, 2026
though arrow-cmp is mostly about comparing data -- I don't think it is really for comparing scheams
Probably arrow-schema is best
I think it would only make sense to put in arrow-rs if there are other users other than DataFUsion that would use it
Since what "semantically compatible" means may be pretty specific to each use case, I am not sure how much value moving the code to arrow-rs would bring
Rich-T-kid commentedon Aug 27, 2026
make sense to me.
I was thinking of introducing an enum/struct that would serve as a gauge for how in-depth the comparison would be:
fn compare_datatype(dt_1: &DataType, dt_2: &DataType, eq: EquivalenceGauge) -> booldecided to go with a struct since it allows us to update this in the future without making it a breaking api change
Rich-T-kid commentedon Aug 28, 2026
implemented in #10902 👍