feat!: upgrade DataFusion to 54 - #8555
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades the DataFusion dependency from version 53.1.0 to 54.0.0, which involves extensive refactoring to adapt to API changes such as the removal of explicit as_any() downcasting, updates to the Cast expression structure, and changes to PruningStatistics and partition_statistics signatures. It also introduces a frozen hash_v1 module to preserve compatibility with legacy count_hash states. The review identified critical compilation errors: a missing import for as_largestring_array in the new hash_v1.rs file, and incorrect iterations over the return value of hash_utils::create_hashes in union_distinct_on.rs since it now returns Result<()> instead of the hashes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
orc and pg-catalog are our managed libraries, make sure it merges to upstream before merging this. |
|
I'm working on the pg-catalog upgrade for datafusion 54. will commit to this branch. |
|
Thanks — I see |
|
DCO is a non-blocking check, just set it passed. |
|
Thanks, DCO is green now. One remaining managed-dependency setup: |
|
datafusion-orc is now on 0.9 |
|
The pg-catalog 0.18 integration uncovered one remaining upstream compatibility gap during real PostgreSQL-protocol SQLness validation: OID aliases are represented as |
|
Updated locally to the managed |
|
Could you confirm the intended ownership for the DataFusion thin-fork pin itself? The existing dependency used |
|
The managed DataFusion 54 path is now available. I created |
|
datafusion 54.1 is out. |
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
Signed-off-by: discord9 <discord9@163.com>
ff94fb3 to
fd09114
Compare
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
43a6b5750GreptimeTeam/sqlparser-rs@9e9019bWhat's changed and what's your intention?
Upgrade GreptimeDB from its DataFusion 53.1 maintenance fork to the official DataFusion 54.1 / Arrow 58 line while retaining the correctness fixes that GreptimeDB still requires.
The final dependency graph is organization-controlled and reproducible:
=54.1.0,GreptimeTeam/datafusion@43a6b575054.1.0@0d1f2ebe2datafusion-pg-catalog0.18.3arrow-pg0.15.0datafusion-orc0.9.0sqlparser0.62.0@9e9019bb1RANGE/FILL/ALIGN/TO/BYextensionsgreptime-protoa937a6455maincutoff and retains batching-flowtime_rangesDataFusion 54.1 thin fork
The thin fork starts from the exact official 54.1.0 commit and carries only fixes still needed by GreptimeDB:
a60023a3ae5cfcc3a8062d818d9array_resizeby Arrow's maximum array sizee4231af92a286efa5dSortPreservingMergeExec4b31e11d033f4161e7TRY_CASTscalar/array overflow nullable218a14c53887df12d5median(NULL)and safely fall back from grouped accumulationd450ac6b533e6bb173ScalarSubqueryExecroots43a6b5750The volatile file-scan projection patch from the earlier 54.0 candidate is not replayed because official 54.1 already contains the adapted upstream fix. GreptimeTeam #3 and #19 are also covered by the official release line; #18 remains excluded because no consumer-level regression demonstrates an impact after the statistics fix.
GreptimeDB integration changes
Stable; makecurrent_schema,current_database,current_schemas, andsession_userobserve the live query context.0A000instead of reinterpreting bytes or emitting rows under stale metadata.attnumordering, and prepared-plan contract failures through the real extended-query protocol.CAST/TRY_CASTexpectations.Latest-main rebase
The branch is rebased onto validated cutoff
main@4acd2340c7, with final headfd09114890.36e0d19d47: restore the single forked sqlparser 0.62 graph;088b306682: migrate four latest-main PromQL casts toCast::new;f0e477ee0e: restoregreptime-proto@a937a645from validated main;fd09114890: migrate common-query tests to DataFusion 54 physical-expression/hash APIs.--force-with-leaseagainst the reviewed old headff94fb3f1c; no bare--forcewas used.Compatibility and limitations
This PR does not intentionally change GreptimeDB public schemas or wire formats. It does change the query-engine dependency boundary and internal plan behavior.
search_pathmodeling remains an upstream follow-up; the current integration models the first supported schema.RangeSelectPartialV1transport is a separate, unmerged lane and is not part of this PR.Validation completed
DataFusion thin fork:
54.1.0@0d1f2ebe2and an exact 12-commit range.datafusion-physical-optimizerClippy.Final GreptimeDB head/cutoff:
git diff --check.common-function,query,promql,servers,common-datasource,mito2,catalog, andtable.cargo check --locked --workspace --all-targets --all-featureson the final cutoff.common-function: 4/4; query regressions: 2/2; catalog ordering: 2/2.Historical pre-rebase validation also included a global Basic SQLness run: 65 standalone and 5 distributed cases generated 70 expected snapshots once, followed by an identical stable rerun. It was not rerun on the final head because the documented escalation condition did not fire: there was no SQL/result conflict, runner/plan-rendering conflict, unexpected snapshot rewrite, or non-identical focused rerun.
One generated SQLness result retains the runner's standard trailing blank line. The reruns are stable and existing tracked snapshots use the same generator convention.
Draft status / remaining gates
main@4acd2340c7and publish final headfd09114890.ff94fb3f1care stale.43a6b575, but neither PR currently has an approval.ACTION_REQUIREDfor the four retained Ning Sun commits:0a4817444d,6518b20ca7,7ef4f96613, ande84c1ad453. Their author signoffs must not be fabricated.PR Checklist