Fix Postgrex/Ecto type bootstrap for pg_catalog queries #10308
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #10307
Tested and verified in this PR: borodark/power_of_three#7
This PR fixes Postgrex/Ecto connectivity to Cube SQL API by addressing two issues:
Filter(CrossJoin), losing LEFT JOIN semantics and causing type bootstrap to failtypsend,typoutput,typreceivecolumns were missing or NULLChanges
New Files
rust/cubesql/cubesql/src/compile/engine/df/optimizers/cross_join_to_left_join.rsNew optimizer rule that detects
Filter(CrossJoin)patterns for pg_catalog tables and converts them back to properLeftJoinoperations.Key features:
Modified Files
rust/cubesql/cubesql/src/compile/engine/df/optimizers/mod.rsCrossJoinToLeftJoinoptimizerrust/cubesql/cubesql/src/compile/query_engine.rsCrossJoinToLeftJointo optimizer pipeline (runs first)rust/cubesql/cubesql/src/compile/engine/information_schema/postgres/pg_type.rstypsend,typoutput,typreceivecolumns with proper OID valuesrust/cubesql/pg-srv/src/pg_type.rsTest Updates
Testing
Repo.all,Repo.one)where: field == ^value)group_by,sum,count)Example Usage
After this fix, Elixir developers can query Cube using familiar Ecto patterns:
Closes
Closes #10307 (Postgrex/Ecto type bootstrap fails with pg_catalog LEFT JOIN queries)