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

chore: upgrade to DataFusion 46.0.0 #3261

Merged
merged 1 commit into from
Mar 9, 2025
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Feb 24, 2025

Description

chore: upgrade to DataFusion 46.0.0

Related Issue(s)

@alamb alamb marked this pull request as draft February 24, 2025 19:29
@github-actions github-actions bot added the binding/rust Issues for the Rust crate label Feb 24, 2025
Copy link

ACTION NEEDED

delta-rs follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

@alamb alamb changed the title core: upgrade to DataFusion 46.0.0 (WORK IN PROGRESS) chore: upgrade to DataFusion 46.0.0 (WORK IN PROGRESS) Feb 24, 2025
@@ -44,6 +44,7 @@ impl<'a, S: ContextProvider> DeltaSqlToRel<'a, S> {
enable_ident_normalization: self.options.enable_ident_normalization,
support_varchar_with_length: false,
enable_options_value_normalization: false,
collect_spans: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is spans?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The source code locations for expressions:

https://docs.rs/sqlparser/latest/sqlparser/tokenizer/struct.Span.html

We are starting to gather / plumb this into DataFusion. This particular setting means the sql planner won't try and pass the span information along. The only thing the spans are used for now is debug / help messages

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah ok thanks for explaining :) I learned something new about datafusion!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW this is a new feature that was starting to be added in DataFusion 46

@alamb
Copy link
Contributor Author

alamb commented Feb 24, 2025

Looks like from CI we also need to update rust to be 1.82

https://github.com/delta-io/delta-rs/actions/runs/13506223447/job/37736308124?pr=3261

error: rustc 1.81.0 is not supported by the following packages:
[email protected] requires rustc 1.82.0
[email protected] requires rustc 1.82.0
...

@alamb
Copy link
Contributor Author

alamb commented Feb 24, 2025

I have a few cleanup PRs I would plan to make as I work on this. Here is the first one:

@alamb
Copy link
Contributor Author

alamb commented Feb 25, 2025

#[derive(Default)]
struct ParquetPredicateVisitor {
struct ParquetVisitor {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to change the way the parquet scan information was found in the two visitors, and I combined them together at the same time as they were mostly boiler plate copy/paste

@alamb
Copy link
Contributor Author

alamb commented Feb 26, 2025

I filed a ticket in datafusion explaining the current test failures

enable_options_value_normalization: false,
},
);
let parser_options = ParserOptions::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.

@@ -20,7 +20,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: '1.81'
toolchain: '1.82'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

DataFusion 46 requires Rust 1.82

You can see CI fail without these changes
https://github.com/delta-io/delta-rs/actions/runs/13591787541/job/38000195037?pr=3261

I don't know what the MSRV policy in delta is so we probably can't merge this PR until it is ok to increase MSRV in delta

@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

I think this PR will pass -- maybe someone could trigger the CI so I can show a clean run?

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 89.77273% with 9 lines in your changes missing coverage. Please review.

Project coverage is 72.16%. Comparing base (9d98ac2) to head (e9a56aa).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/operations/load_cdf.rs 87.50% 2 Missing and 2 partials ⚠️
crates/sql/src/parser.rs 0.00% 1 Missing and 1 partial ⚠️
crates/core/src/delta_datafusion/expr.rs 66.66% 0 Missing and 1 partial ⚠️
crates/core/src/delta_datafusion/mod.rs 97.50% 1 Missing ⚠️
python/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3261   +/-   ##
=======================================
  Coverage   72.16%   72.16%           
=======================================
  Files         144      144           
  Lines       45771    45784   +13     
  Branches    45771    45784   +13     
=======================================
+ Hits        33030    33042   +12     
+ Misses      10651    10650    -1     
- Partials     2090     2092    +2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

🤔 there are some python failures here. Seeing if I can figure out what is going on

https://github.com/delta-io/delta-rs/actions/runs/13592071811/job/38008047004?pr=3261

FAILED tests/test_cdf.py::test_read_cdf_partitioned_projection - pyo3_runtime.PanicException: index out of bounds: the len is 3 but the index is 3
FAILED tests/test_cdf.py::test_read_cdf_last_version - pyo3_runtime.PanicException: index out of bounds: the len is 2 but the index is 2
==== 2 failed, 495 passed, 7 skipped, 35 deselected, 95 warnings in 40.15s =====

@alamb
Copy link
Contributor Author

alamb commented Feb 28, 2025

🤔 there are some python failures here. Seeing if I can figure out what is going on

https://github.com/delta-io/delta-rs/actions/runs/13592071811/job/38008047004?pr=3261

FAILED tests/test_cdf.py::test_read_cdf_partitioned_projection - pyo3_runtime.PanicException: index out of bounds: the len is 3 but the index is 3
FAILED tests/test_cdf.py::test_read_cdf_last_version - pyo3_runtime.PanicException: index out of bounds: the len is 2 but the index is 2
==== 2 failed, 495 passed, 7 skipped, 35 deselected, 95 warnings in 40.15s =====

Could someone tell me how to run these tests locally or give me a rust stack trace? I don't really understand what is failing here

@blaginin
Copy link

cd python
make develop
RUST_BACKTRACE=1 uv run pytest tests/test_cdf.py -s -k "test_read_cdf_partitioned_projection"

trace.txt

@alamb
Copy link
Contributor Author

alamb commented Mar 2, 2025

@alamb
Copy link
Contributor Author

alamb commented Mar 2, 2025

Ok, updated with latest release candidate. Here is hoping for a clean CI run 🙏

@alamb
Copy link
Contributor Author

alamb commented Mar 2, 2025

Screenshot 2025-03-02 at 3 11 15 PM

SUccess! Thank you so much @blaginin for making this happen

@alamb alamb marked this pull request as ready for review March 3, 2025 15:54
@alamb alamb requested a review from fvaleye as a code owner March 3, 2025 15:54
@alamb alamb changed the title chore: upgrade to DataFusion 46.0.0 (WORK IN PROGRESS) chore: upgrade to DataFusion 46.0.0 Mar 9, 2025
Copy link
Contributor Author

@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.

Thanks @ion-elgreco -- I'll update the to use the released verson of datafusion now

@ion-elgreco ion-elgreco changed the title chore: upgrade to DataFusion 46.0.0 chore: upgrade to DataFusion 46.0.0 Mar 9, 2025
Copy link
Collaborator

@ion-elgreco ion-elgreco 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 @blaginin !

@ion-elgreco ion-elgreco enabled auto-merge March 9, 2025 13:24
@ion-elgreco ion-elgreco added this pull request to the merge queue Mar 9, 2025
Merged via the queue into delta-io:main with commit c149502 Mar 9, 2025
28 checks passed
@alamb
Copy link
Contributor Author

alamb commented Mar 9, 2025

🎉

@alamb alamb deleted the alamb/df_46 branch March 9, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package binding/rust Issues for the Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants