Hi,
I’m encountering an issue where a reflection that works correctly when querying through the Dremio UI or REST API is not picked up when executing the same SQL query via Arrow Flight (Flight SQL).
In the query profile for the Flight execution, under the Acceleration tab, I see this message:
algebraic_matching: Skipping agg join matching due to limit. Number of joins: 33, Limit: 16
This message does not appear in the UI or REST execution of the same query, and in those cases, the reflection is applied successfully with AGGREGATE_REWRITE
.
I’m wondering:
- Why would the optimizer behavior differ between Arrow Flight and other access methods?
- Is this join limit (16) specific to the execution context used by Flight SQL?
- Can this limit be configured or increased to allow reflection matching in more complex queries via Flight?
- Are there any planner settings or context options I should be setting explicitly when using Flight?
It seems like the number of joins is causing the reflection matching logic to skip, but only when using Arrow Flight. I’d need help to know whether this is expected behavior, and how to work around or resolve it.
Profiles:
rest-api-plan-with-reflections.zip (113.8 KB)
arrow-flight-without-reflections.zip (242.4 KB)
arrow-flight-with-reflections.zip (107.4 KB)
Build Info:
- Build: 25.1.6-202501021803480419-127757a4
- Edition: AWS Edition (activated)
Thanks in advance!