Skip to content

Conversation

@andygrove
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

As we add more expressions from datafusion-spark we would need to update two identical code blocks, so this PR refactors them to avoid duplication.

What changes are included in this PR?

How are these changes tested?

@andygrove andygrove changed the title minore: Refactor PhysicalPlanner::default() to avoid duplicate code minor: Refactor PhysicalPlanner::default() to avoid duplicate code May 30, 2025
exec_context_id: TEST_EXEC_CONTEXT_ID,
session_ctx,
}
Self::new(Arc::new(SessionContext::new()))
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that Self::new will register the UDF:

    pub fn new(session_ctx: Arc<SessionContext>) -> Self {
        // register UDFs from datafusion-spark crate
        session_ctx.register_udf(ScalarUDF::new_from_impl(SparkExpm1::default()));
        Self {
            exec_context_id: TEST_EXEC_CONTEXT_ID,
            session_ctx,
        }
    }

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.39%. Comparing base (f09f8af) to head (2566439).
Report is 233 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1821      +/-   ##
============================================
+ Coverage     56.12%   59.39%   +3.27%     
- Complexity      976     1151     +175     
============================================
  Files           119      129      +10     
  Lines         11743    12628     +885     
  Branches       2251     2368     +117     
============================================
+ Hits           6591     7501     +910     
+ Misses         4012     3919      -93     
- Partials       1140     1208      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

nice clean @andygrove

@andygrove andygrove merged commit 42dfb35 into apache:main Jun 3, 2025
103 of 104 checks passed
@andygrove andygrove deleted the minor-refactor branch June 3, 2025 16:20
mbutrovich added a commit to mbutrovich/datafusion-comet that referenced this pull request Nov 4, 2025
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.

3 participants