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

Minor: Refactor benchmark imports to use util module #12885

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

loloxwg
Copy link
Contributor

@loloxwg loloxwg commented Oct 12, 2024

This pull request focuses on refactoring the import statements across multiple files in the benchmarks module to improve code organization by consolidating utility imports into a single module.

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

yes

Are there any user-facing changes?

Updated various benchmarks to import `BenchmarkRun`, `CommonOpt`, and `AccessLogOpt` from the `util` module. This improvement organizes and consolidates imports for better maintainability and consistency across the project.
@@ -26,7 +26,7 @@ use datafusion::datasource::listing::{
use datafusion::datasource::MemTable;
use datafusion::prelude::CsvReadOptions;
use datafusion::{arrow::util::pretty, error::Result, prelude::SessionContext};
use datafusion_benchmarks::BenchmarkRun;
use datafusion_benchmarks::util::BenchmarkRun;
Copy link
Member

Choose a reason for hiding this comment

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

i think the real problem (if any) is that datafusion_benchmarks::BenchmarkRun and datafusion_benchmarks::util::BenchmarkRun are both valid import path.

there are 3 ways to go about it

  • stop re-exporting BenchmarkRun from crate root, require ::util::
  • make util private, accept only BenchmarkRun import from crate root
  • ignore the problem and give up on consistency

Copy link
Contributor

Choose a reason for hiding this comment

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

stop re-exporting BenchmarkRun from crate root, require ::util::

I think that is what this PR does which seems reasonable to me

@@ -21,5 +21,4 @@ pub mod imdb;
pub mod parquet_filter;
pub mod sort;
pub mod tpch;
mod util;
pub use util::*;
pub mod util;
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems like an improvment to me (not re-export everything from util into the banchmark crate namespace

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 @loloxwg and @findepi for the review

@alamb alamb changed the title Refactor imports to use util module Minor: Refactor benchmark imports to use util module Oct 15, 2024
@alamb alamb added the development-process Related to development process of DataFusion label Oct 15, 2024
@alamb alamb merged commit f8add9b into apache:main Oct 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development-process Related to development process of DataFusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants