Skip to content

Pushdown projection below NestedLoopJoinExec #14161

@jayzhan211

Description

@jayzhan211
          A solid example of what I am looking for is, these plans will project a&c (first CsvExec), and b only (second CsvExec). Embedding the projection into CsvExec is already done, we just need to pushdown the projection below NestedLoopJoinExec

Originally posted by @berkaysynnada in #14120 (comment)

Current optimization is like

        let expected = [
            "NestedLoopJoinExec: join_type=Inner, filter=a@0 < b@1, projection=[c@2]",
            "  CsvExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], has_header=false",
            "  CsvExec: file_groups={1 group: [[x]]}, projection=[a, b, c, d, e], has_header=false",
        ];

where we could further pushdown projection to CscExec

        let expected = [
            "NestedLoopJoinExec: join_type=Inner, filter=a@0 < b@1, projection=[c@2]",
            "  CsvExec: file_groups={1 group: [[x]]}, projection=[a, c], has_header=false",
            "  CsvExec: file_groups={1 group: [[x]]}, projection=[b], has_header=false",
        ];

Since we only requires a, c from left side and b from right side

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions