From 4d2d5b06125f62ce5f43265867e19b075ad969dc Mon Sep 17 00:00:00 2001 From: Anthony Alaribe Date: Mon, 26 Oct 2026 00:56:25 +0100 Subject: [PATCH] fix: preserve aggregate input ordering through pgwire --- Cargo.lock | 68 ++++++++++++++++----------------- Cargo.toml | 66 ++++++++++++++++---------------- tests/suite/pg_client_compat.rs | 24 ++++++++++++ 3 files changed, 91 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76e76a2e..769dc950 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2202,7 +2202,7 @@ dependencies = [ [[package]] name = "datafusion" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-schema", @@ -2254,7 +2254,7 @@ dependencies = [ [[package]] name = "datafusion-catalog" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-trait", @@ -2278,7 +2278,7 @@ dependencies = [ [[package]] name = "datafusion-catalog-listing" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-trait", @@ -2301,7 +2301,7 @@ dependencies = [ [[package]] name = "datafusion-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-ipc", @@ -2327,7 +2327,7 @@ dependencies = [ [[package]] name = "datafusion-common-runtime" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "futures", "log", @@ -2337,7 +2337,7 @@ dependencies = [ [[package]] name = "datafusion-datasource" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-compression", @@ -2373,7 +2373,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-arrow" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-ipc", @@ -2397,7 +2397,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-csv" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-trait", @@ -2420,7 +2420,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-json" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-trait", @@ -2443,7 +2443,7 @@ dependencies = [ [[package]] name = "datafusion-datasource-parquet" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-schema", @@ -2475,12 +2475,12 @@ dependencies = [ [[package]] name = "datafusion-doc" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" [[package]] name = "datafusion-execution" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-buffer", @@ -2505,7 +2505,7 @@ dependencies = [ [[package]] name = "datafusion-expr" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-schema", @@ -2529,7 +2529,7 @@ dependencies = [ [[package]] name = "datafusion-expr-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2540,7 +2540,7 @@ dependencies = [ [[package]] name = "datafusion-functions" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-buffer", @@ -2571,7 +2571,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2591,7 +2591,7 @@ dependencies = [ [[package]] name = "datafusion-functions-aggregate-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2615,7 +2615,7 @@ dependencies = [ [[package]] name = "datafusion-functions-nested" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-ord", @@ -2639,7 +2639,7 @@ dependencies = [ [[package]] name = "datafusion-functions-table" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "async-trait", @@ -2654,7 +2654,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2670,7 +2670,7 @@ dependencies = [ [[package]] name = "datafusion-functions-window-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "datafusion-common", "datafusion-physical-expr-common", @@ -2679,7 +2679,7 @@ dependencies = [ [[package]] name = "datafusion-macros" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "datafusion-doc", "quote", @@ -2689,7 +2689,7 @@ dependencies = [ [[package]] name = "datafusion-optimizer" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "chrono", @@ -2732,7 +2732,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-schema", @@ -2755,7 +2755,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-adapter" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2769,7 +2769,7 @@ dependencies = [ [[package]] name = "datafusion-physical-expr-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "chrono", @@ -2786,7 +2786,7 @@ dependencies = [ [[package]] name = "datafusion-physical-optimizer" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "datafusion-physical-plan" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "arrow-data", @@ -2865,7 +2865,7 @@ dependencies = [ [[package]] name = "datafusion-proto" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-catalog", @@ -2891,7 +2891,7 @@ dependencies = [ [[package]] name = "datafusion-proto-common" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2901,7 +2901,7 @@ dependencies = [ [[package]] name = "datafusion-proto-models" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "datafusion-common", "datafusion-proto-common", @@ -2911,7 +2911,7 @@ dependencies = [ [[package]] name = "datafusion-pruning" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "datafusion-common", @@ -2926,7 +2926,7 @@ dependencies = [ [[package]] name = "datafusion-session" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow-schema", "async-trait", @@ -2940,7 +2940,7 @@ dependencies = [ [[package]] name = "datafusion-sql" version = "55.1.0" -source = "git+https://github.com/tonyalaribe/datafusion.git?rev=2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0#2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" +source = "git+https://github.com/tonyalaribe/datafusion.git?rev=1f06ab1bd4f27506e0e12d435c36f2673dfbbd98#1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" dependencies = [ "arrow", "bigdecimal", diff --git a/Cargo.toml b/Cargo.toml index 90b86417..6df2c6de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -273,39 +273,39 @@ datafusion-postgres = { git = "https://github.com/apitoolkit/datafusion-postgres # DataFusion 54.1 with shared sort-buffer reservations, positional Parquet scan protection, SQL DEALLOCATE ALL, # and the existing UPDATE FROM support. # Keep the workspace crates on one source so their public Rust types agree. -datafusion = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-catalog = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-catalog-listing = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-common-runtime = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-datasource = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-datasource-arrow = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-datasource-csv = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-datasource-json = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-datasource-parquet = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-doc = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-execution = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-expr = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-expr-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-aggregate = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-aggregate-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-nested = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-table = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-window = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-functions-window-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-macros = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-optimizer = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-physical-expr = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-physical-expr-adapter = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-physical-expr-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-physical-optimizer = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-physical-plan = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-proto = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-proto-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-pruning = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-session = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } -datafusion-sql = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "2f17a2380e5cb3b32d3d70cf97cea37ed45d61f0" } +datafusion = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-catalog = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-catalog-listing = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-common-runtime = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-datasource = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-datasource-arrow = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-datasource-csv = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-datasource-json = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-datasource-parquet = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-doc = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-execution = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-expr = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-expr-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-aggregate = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-aggregate-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-nested = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-table = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-window = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-functions-window-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-macros = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-optimizer = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-physical-expr = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-physical-expr-adapter = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-physical-expr-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-physical-optimizer = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-physical-plan = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-proto = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-proto-common = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-pruning = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-session = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } +datafusion-sql = { git = "https://github.com/tonyalaribe/datafusion.git", rev = "1f06ab1bd4f27506e0e12d435c36f2673dfbbd98" } # tikv-jemalloc-sys 0.6.1 vendored with a single build.rs delta: honour # `JEMALLOC_SYS_PROF_BACKTRACE` so the heap profiler can be built with a working # unwinder (`--enable-prof-libunwind`). Upstream passes `--enable-prof` alone and diff --git a/tests/suite/pg_client_compat.rs b/tests/suite/pg_client_compat.rs index aec1eb2b..7022b33f 100644 --- a/tests/suite/pg_client_compat.rs +++ b/tests/suite/pg_client_compat.rs @@ -259,3 +259,27 @@ async fn pgadmin_dashboard_rewrites_every_union_branch() -> Result<()> { assert_eq!(charts, [r#"session_stats={"Idle":0,"Total":0}"#, r#"tps_stats={"Transactions":0}"#]); Ok(()) } + +#[tokio::test(flavor = "multi_thread")] +async fn aggregate_ordering_preserves_input_values_and_output_aliases() -> Result<()> { + let server = TestServer::start().await?; + let client = server.client().await?; + for (sort, expected) in [("MAX(last_seen) DESC", ["10", "2"]), ("MAX(audience_sessions.last_seen) DESC", ["10", "2"]), ("last_seen DESC", ["2", "10"])] { + let sql = format!( + "WITH audience_sessions(user_id, last_seen) AS (VALUES ('u1', 2), ('u2', 10)) SELECT MAX(last_seen)::TEXT AS last_seen FROM audience_sessions WHERE last_seen > $1::BIGINT GROUP BY user_id ORDER BY {sort}" + ); + let rows = client.query(&sql, &[&0_i64]).await?; + let actual = rows.iter().map(|row| row.get::<_, String>(0)).collect::>(); + assert_eq!(actual, expected, "extended protocol: {sort}"); + let messages = client.simple_query(&sql.replace("$1::BIGINT", "0")).await?; + let actual = messages + .iter() + .filter_map(|message| match message { + tokio_postgres::SimpleQueryMessage::Row(row) => row.get(0), + _ => None, + }) + .collect::>(); + assert_eq!(actual, expected, "simple protocol: {sort}"); + } + Ok(()) +}