apache / datafusion

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

Build join schema in a single place #6046

Open comphead opened 1 year ago

comphead commented 1 year ago

Is your feature request related to a problem or challenge?

There are two fn build_join_schema implementations https://github.com/apache/arrow-datafusion/blob/3ad7734a7e5b1844b02f1374d0dc1c441bef216d/datafusion/expr/src/logical_plan/builder.rs#L1039 https://github.com/apache/arrow-datafusion/blob/6e819d6c2b9280198c67fa16df3e54c79ce46ca2/datafusion/core/src/physical_plan/joins/utils.rs#L349

which likely doing the same thing. Ideally to have single code base for all usecases

Describe the solution you'd like

have single code base for all build join schema usecases

Describe alternatives you've considered

None

Additional context

Followup from https://github.com/apache/arrow-datafusion/pull/6015#discussion_r1168475782

comphead commented 1 year ago

Working on this issue

mingmwang commented 1 year ago

Looks like one is for logic plan and one is for physical plan ?

comphead commented 1 year ago

Looks like one is for logic plan and one is for physical plan ?

Thats correct, but will try to figure out if we can factor out the common part