File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
datafusion/expr/src/logical_plan Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1744,6 +1744,14 @@ pub fn requalify_sides_if_needed(
17441744 // 1. Duplicate qualified fields: both sides have same relation.name
17451745 // 2. Duplicate unqualified fields: both sides have same unqualified name
17461746 // 3. Ambiguous reference: one side qualified, other unqualified, same name
1747+ //
1748+ // Implementation note: This uses a simple O(n*m) nested loop rather than
1749+ // a HashMap-based O(n+m) approach. The nested loop is preferred because:
1750+ // - Schemas are typically small (per TPCH benchmark, max is 16 columns),
1751+ // so n*m is negligible
1752+ // - Early return on first conflict makes common case very fast
1753+ // - Code is simpler and easier to reason about
1754+ // - Called only during plan construction, not in execution hot path
17471755 for l in & left_cols {
17481756 for r in & right_cols {
17491757 if l. name != r. name {
You can’t perform that action at this time.
0 commit comments