Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply filter before flat mapping in logical planner #3730

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

purplefox
Copy link
Contributor

Description

This PR changes the logic plan so that any filter node gets applied before a flat map node.

Testing done

Non functional change but I've added a new QTT test for a table function with a where clause anyway.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@purplefox purplefox requested a review from a team as a code owner November 4, 2019 13:22
Copy link
Contributor

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @purplefox

It would probably be worth adding a unit test along the lines of shouldNotInvokeUdtfsForFilteredRows or similar somewhere so that we've got a test that fails should someone put this back the wrong way. Maybe create a unit test for the LogicalPlanner if one doesn't already exist.

@purplefox
Copy link
Contributor Author

purplefox commented Nov 4, 2019

It would probably be worth adding a unit test along the lines of shouldNotInvokeUdtfsForFilteredRows or similar somewhere so that we've got a test that fails should someone put this back the wrong way. Maybe create a unit test for the LogicalPlanner if one doesn't already exist.

Hey @big-andy-coates - tbh I am not a big fan of unit tests constraining details of the implementation, especially non functional detail; the tests become very brittle and they can force a straight jacket around the implementation making it hard to refactor. Let the implementation be free, and constrain the interface not the implementation! (Don't get me started on fine grained unit tests and TDD, but I think you can infer my opinion on that already ;) )

For this kind of thing, I'd say the right way of checking behaviour is via a performance regression test (which I know we don't have yet). If the performance does regress after someone changes the order then we'll catch it. But maybe the performance doesn't regress after someone changes it, in which case it's OK to re-order it, and perhaps our assumptions about what is slow and what is not were wrong in the first place.

@purplefox purplefox merged commit c2f35e3 into confluentinc:master Nov 4, 2019
@purplefox purplefox deleted the filter_before_flatmap branch January 26, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants