apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.34k stars 1.2k forks source link

Getting "Endpoints of an Interval should have the same type" during plan analysis #13417

Closed Blizzara closed 6 days ago

Blizzara commented 1 week ago

Describe the bug

(I'm still working on trying to understand what causes this, but filing already in case someone has seen this before/has ideas.)

While running DataFusion (42.2.0) on some not-super-complex plan on production data, we're getting this error Endpoints of an Interval should have the same type... According to backtrace, it's coming AnalysisContext::try_from_statistics calling ExprBoundaries::try_from_column which then calls Interval::try_new.

Given that's looking at statics for a column, and comparing the min and max, why would those ever have different datatypes...?

To Reproduce

Reproes on the production data which I unfortunately cannot share; my attempts at reproing with fake inputs haven't succeeded.

Expected behavior

No response

Additional context

No response

Blizzara commented 6 days ago

Duplicate of https://github.com/apache/datafusion/issues/13186, fixed by https://github.com/apache/datafusion/pull/13187 (I still need to confirm that actually fixes it but seems 99% likely so I'll close this off in the meantime).