Skip to content

Conversation

@2010YOUY01
Copy link
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

What changes are included in this PR?

with_predicate() is a builder pattern API to overwrite predicate field for ParquetSource. Now it's also resetting the metrics, this step should be unnecessary.

This change was introduced by a giant refactor #14224, so likely this is done by mistake, instead of some certain reasons.

Are these changes tested?

Existing test has covered metrics.
Since now this with_predicate() is called before constructing metrics set, so it's not introducing any bug, and no test case needs to be changed.

Are there any user-facing changes?

@github-actions github-actions bot added the datasource Changes to the datasource crate label Oct 1, 2025
@2010YOUY01 2010YOUY01 closed this Oct 1, 2025
@2010YOUY01 2010YOUY01 reopened this Oct 1, 2025
self
}

fn with_metrics(mut self, metrics: ExecutionPlanMetricsSet) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

Is this removal intentional ?
It is not related to with_predicate()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, with_predicate() is the only place calling this deleted function, and now it's removed

Copy link
Member

Choose a reason for hiding this comment

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

Right!
with_metrics() was private!
But there is no setter for metrics now... How is it supposed to be used ? Use directly the field ?!

}

/// Set predicate information
pub fn with_predicate(&self, predicate: Arc<dyn PhysicalExpr>) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

This method is a bit strange.
The other with_**() methods accept mut self and modify in-place. Only this method accepts &self and makes a clone of itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it would be nice to figure out why there is this discrepancy

Copy link
Contributor

Choose a reason for hiding this comment

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

Filed #17917 to track

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @2010YOUY01 and @martin-g

}

/// Set predicate information
pub fn with_predicate(&self, predicate: Arc<dyn PhysicalExpr>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it would be nice to figure out why there is this discrepancy

@alamb
Copy link
Contributor

alamb commented Oct 4, 2025

Thanks again @2010YOUY01 and @martin-g

Merged via the queue into apache:main with commit 5e558b2 Oct 4, 2025
53 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants