Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Oct 1, 2025

Which issue does this PR close?

Rationale for this change

While reviewing #17835 I noticed the same schema was being made many times in the tests. While we probably can't notice a difference in performance, it would be nice to avoid this

What changes are included in this PR?

Reuse the same DFSchemaRef for the tests

Are these changes tested?

By CI

Are there any user-facing changes?

@github-actions github-actions bot added the optimizer Optimizer rules label Oct 1, 2025
])
.to_dfschema_ref()
.unwrap()
static TEST_SCHEMA: LazyLock<DFSchemaRef> = LazyLock::new(|| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just uses a static LazyLock to avoid recreating the same schemas over and over again

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @alamb !

@alamb alamb added this pull request to the merge queue Oct 2, 2025
@alamb
Copy link
Contributor Author

alamb commented Oct 2, 2025

Thanks @comphead and @martin-g

Merged via the queue into apache:main with commit 1ac8186 Oct 2, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants