Skip to content

Conversation

@danielhumanmod
Copy link
Contributor

@danielhumanmod danielhumanmod commented Nov 21, 2025

Which issue does this PR close?

Closes #1343 .

Rationale for this change

DataFusion 51 introduces new changes in its physical plan serde APIs, metrics system, and tonic/prost/Arrow dependencies

Reference: https://datafusion.apache.org/library-user-guide/upgrading.html#datafusion-51-0-0

What changes are included in this PR?

  1. Update Rust MSRV
  • rust-version 1.86 → 1.88 (required by DF51)
  1. Upgrade DataFusion ecosystem and protobuf/RPC dependencies
  • datafusion* → 51.0.0
  • arrow* → 57.0.0
  • tonic* / prost* → 0.14
  1. Adapt to DF51 API breaking changes
  • SessionContext → TaskContext
  • LogicalPlan::schema().as_ref() → as_arrow()
  • UnnestExec::new()
  • Updated physical plan serde:
    • physical_plan_from_bytes(.., ctx.task_ctx())
    • try_into_physical_plan(ctx.task_ctx(), codec)
    • PhysicalExtensionCodec::try_decode(ctx: &TaskContext)
  • Updated related tests
  1. Support new DF51 metrics in Ballista (proto / from_proto / to_proto)
  • OutputBytes
  • PruningMetrics
  • Ratio

(no semantic changes)

Are there any user-facing changes?

No user-facing behavior changes.
This PR only updates internal dependencies and adapts Ballista to the breaking changes introduced by DataFusion 51.
All external APIs, CLI behavior, and user-visible features remain unchanged.

@danielhumanmod danielhumanmod marked this pull request as ready for review November 23, 2025 06:03
edition = "2021"
# we should try to follow datafusion version
rust-version = "1.86.0"
rust-version = "1.88.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Try to align with DataFusion rust version, feel free to let me know if we dont want to bump it right now
https://github.com/apache/datafusion/blob/main/Cargo.toml#L80

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense

@danielhumanmod
Copy link
Contributor Author

Hey @milenkovicm — I continued your work by adding the new metrics type support, adjusting DF API usages, and updating the related tests. CI looks fine, appreciate your feedback whenever you get a chance. Thanks!

@milenkovicm
Copy link
Contributor

Thanks @danielhumanmod will have a look later today

Copy link
Contributor

@milenkovicm milenkovicm left a comment

Choose a reason for hiding this comment

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

I think pr makes sense, thanks a lot! just few minor comments. Also, could you please update datafusion and datafusion-common.proto files to reflect df 51 versions (we usually do it with every df update)

.build();
let ctx = SessionContext::new_with_state(session_state);
//
let ctx = SessionContext::new_with_state(session_state).task_ctx();
Copy link
Contributor

Choose a reason for hiding this comment

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

can we create TaskContext directly? we should have all required info for TaskContext

//
//
//
let ctx = SessionContext::new_with_state(state).task_ctx();
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment, can we create task context directly ?

edition = "2021"
# we should try to follow datafusion version
rust-version = "1.86.0"
rust-version = "1.88.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense

@danielhumanmod
Copy link
Contributor Author

I think pr makes sense, thanks a lot! just few minor comments. Also, could you please update datafusion and datafusion-common.proto files to reflect df 51 versions (we usually do it with every df update)

Thanks for the feedback! Updated all the comments in latest commit, feel free to merge it or let me know any further improvement

@milenkovicm
Copy link
Contributor

thanks @danielhumanmod it looks good!
I've pushed commit, removed unnecessary context creation from few more places

@milenkovicm milenkovicm merged commit eab22e2 into apache:main Nov 28, 2025
28 checks passed
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.

Update to datafusion 51

2 participants