Skip to content

Conversation

@hililiwei
Copy link
Contributor

This PR optimizes the TableScanContext to make it easier to read and modify.
Before this PR, if you want to add a field, you need to modify a lot.

@github-actions github-actions bot added the core label Oct 14, 2022
@xxubai
Copy link
Contributor

xxubai commented Oct 14, 2022

I believe it's better to move the construction responsibility of the TableScanContext to the inner Builder. Have the builder perform the create operation instead of new TableScanContext().

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

looks great, but I would rename the copy method from builder to from as I think this is clearer.

@rdblue / @hililiwei I also created #5985 to have a slightly shorter alternative (171 vs 376 LOC) that doesn't require a custom builder.

.metricsReporter(context.metricsReporter);
}

static Builder builder(TableScanContext context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably just call this from() rather than build() to make it clearer that this is copying state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good. Done.

@hililiwei
Copy link
Contributor Author

looks great, but I would rename the copy method from builder to from as I think this is clearer.

@rdblue / @hililiwei I also created #5985 to have a slightly shorter alternative (171 vs 376 LOC) that doesn't require a custom builder.

Thanks fro your review. #5985 Annotations is really more concise.

@rdblue
Copy link
Contributor

rdblue commented Oct 21, 2022

I don't think that this is worth the change. The context doesn't change very often (this is the 4th change in the 2 years since this was introduced) and I don't think that a builder helps much. In addition, adding a builder is another class to maintain and would be passing state around again.

@jackye1995
Copy link
Contributor

Close with #5985

@jackye1995 jackye1995 closed this Apr 27, 2023
@hililiwei hililiwei deleted the Refactoring_TableScanContext branch April 27, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants