Skip to content

Write "upgrade guide" for DataFusion 44.0.0 #13702

Description

@andygrove

Is your feature request related to a problem or challenge?

DataFusion 44.0.0 has breaking changes that require downstream projects to make code changes. Let's document these as we upgrade our own subprojects (Python, Comet, Ballista) to make life easier for other downstream projects.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. self-assigned this
    on Dec 9, 2024
  2. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor

    I plan on adding notes to this issue as I encounter issues while upgrading Comet to use latest DF. First couple of issues:

    • down_cast_any_ref was removed from the public API. Perhaps we should consider adding it back (and mark it as deprecated)?
    • PhysicalExpr trait no longer has dyn_hash method and it is now necessary to implement DynEq. This may cause confusion unless we explain that deriving Hash, PartialEq, Eq for structs will automatically implement these traits.
  3. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor

    next issue:

    60 |             signature: Signature::coercible(vec![DataType::Float64], Volatility::Immutable),
       |                                                  ^^^^^^^^^^^^^^^^^ expected `Arc<dyn LogicalType>`, found `DataType`
    

    Solution was to change DataType::Float64 to Arc::new(NativeType::Float64)

  4. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor

    We can't just derive PartialEq for expressions that contain other expressions due to rust-lang/rust#78808:

    error[E0507]: cannot move out of `other.child` which is behind a shared reference
      --> spark-expr/src/list.rs:49:5
       |
    47 | #[derive(Debug, Hash, PartialEq, Eq)]
       |                       --------- in this derive macro expansion
    

    We have to implement PartialEq manually instead.

  5. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor

    GroupValues and new_group_values were removed from the public API without being deprecated first. It does not impact Comet; I'm just pointing this out.

  6. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor

    public function find_df_window_func was removed in #13201. It would have been better to mark it deprecated and have it return None.

  7. andygrove commented on Dec 9, 2024

    @andygrove
    MemberAuthor
    error[E0308]: mismatched types
         |
    1929 |         datafusion::physical_plan::windows::create_window_expr(
         |         ------------------------------------------------------ arguments to this function are incorrect
    ...
    1934 |             sort_exprs,
         |             ^^^^^^^^^^ expected `&LexOrdering`, found `&[PhysicalSortExpr]`
    

    fixed by changing sort_exprs to &LexOrdering::new(sort_exprs.to_vec()),

  8. andygrove commented on Dec 10, 2024

    @andygrove
    MemberAuthor

    I am now running into:

    Error from DataFusion: return_type_from_exprs shoud be called instead.
    This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker.
    
  9. Omega359 commented on Dec 10, 2024

    @Omega359
    Contributor

    Error from DataFusion: return_type_from_exprs shoud be called instead.

    The only place that has that typo is date_part which was changed in #13466 @jayzhan211

  10. andygrove commented on Dec 10, 2024

    @andygrove
    MemberAuthor

    ScalarUDFImpl.return_type is part of DataFusion's public API but returns an internal error if called, which doesn't seem correct. Should we deprecate this function and change the error type?

        fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
            internal_err!("return_type_from_exprs shoud be called instead")
        }
    

    edit: it only returns this error in DatePartFunc

  11. andygrove commented on Dec 10, 2024

    @andygrove
    MemberAuthor

    I created a PR to deprecate return_type and revert the breaking change - #13717

  12. andygrove commented on Dec 10, 2024

    @andygrove
    MemberAuthor

    I am now running into failures in Comet tests that use miri:

    error: unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
        --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/psm-0.1.24/src/lib.rs:319:14
         |
    319  |     unsafe { rust_psm_stack_pointer() }
         |              ^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `rust_psm_stack_pointer` on OS `linux`
         |
         = help: if this is a basic API commonly used on this target, please report an issue with Miri
         = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
         = note: BACKTRACE on thread `execution::data`:
         = note: inside `psm::stack_pointer` at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/psm-0.1.24/src/lib.rs:319:14: 319:38
         = note: inside `stacker::current_stack_ptr` at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.17/src/lib.rs:98:13: 98:33
         = note: inside `stacker::remaining_stack` at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.17/src/lib.rs:91:23: 91:42
         = note: inside `stacker::maybe_grow::<std::result::Result<datafusion_common::tree_node::Transformed<datafusion_physical_expr::tree_node::ExprContext<std::option::Option<petgraph::graph_impl::NodeIndex>>>, datafusion_common::DataFusionError>, {closure@datafusion_common::tree_node::TreeNode::transform_up::transform_up_impl<datafusion_physical_expr::tree_node::ExprContext<std::option::Option<petgraph::graph_impl::NodeIndex>>, {closure@datafusion_physical_expr::utils::build_dag<datafusion_physical_expr::intervals::cp_solver::ExprIntervalGraphNode, {closure@datafusion_physical_expr::intervals::cp_solver::ExprIntervalGraph::try_new::{closure#0}}>::{closure#0}}>::{closure#0}}>` at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.17/src/lib.rs:50:30: 50:47
         ```
    
  13. andygrove commented on Dec 11, 2024

    @andygrove
    MemberAuthor

    The miri test failures are related to DataFusion using the recursive crate in #13310

  14. andygrove commented on Dec 13, 2024

    @andygrove
    MemberAuthor

    I filed #13766 to consider making recursive an optional feature

  15. Omega359 commented on Feb 4, 2025

    @Omega359
    Contributor

    @andygrove - can this issue be closed now?

  16. andygrove commented on Feb 4, 2025

    @andygrove
    MemberAuthor

    Yes, I'll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions