From aaa762c476160fe36f176873318793dcc53f932a Mon Sep 17 00:00:00 2001 From: Kumar Ujjawal Date: Fri, 14 Nov 2025 15:56:39 +0530 Subject: [PATCH 1/3] refactor with assert_or_internal_err!() in datafusion/expr --- datafusion/expr/src/expr_schema.rs | 9 +-- .../expr/src/logical_plan/invariants.rs | 21 +++--- datafusion/expr/src/logical_plan/plan.rs | 74 ++++++++++--------- .../expr/src/type_coercion/functions.rs | 19 +++-- datafusion/expr/src/udf.rs | 22 ++++-- 5 files changed, 75 insertions(+), 70 deletions(-) diff --git a/datafusion/expr/src/expr_schema.rs b/datafusion/expr/src/expr_schema.rs index 9e8d6080b82c..601fb5105bbb 100644 --- a/datafusion/expr/src/expr_schema.rs +++ b/datafusion/expr/src/expr_schema.rs @@ -775,7 +775,7 @@ mod tests { use super::*; use crate::{col, lit, out_ref_col_with_metadata}; - use datafusion_common::{internal_err, DFSchema, ScalarValue}; + use datafusion_common::{assert_or_internal_err, DFSchema, ScalarValue}; macro_rules! test_is_expr_nullable { ($EXPR_TYPE:ident) => {{ @@ -1000,11 +1000,8 @@ mod tests { impl ExprSchema for MockExprSchema { fn nullable(&self, _col: &Column) -> Result { - if self.error_on_nullable { - internal_err!("nullable error") - } else { - Ok(self.field.is_nullable()) - } + assert_or_internal_err!(!self.error_on_nullable, "nullable error"); + Ok(self.field.is_nullable()) } fn field_from_column(&self, _col: &Column) -> Result<&Field> { diff --git a/datafusion/expr/src/logical_plan/invariants.rs b/datafusion/expr/src/logical_plan/invariants.rs index ccdf9e444b8f..a067f3c72016 100644 --- a/datafusion/expr/src/logical_plan/invariants.rs +++ b/datafusion/expr/src/logical_plan/invariants.rs @@ -16,9 +16,9 @@ // under the License. use datafusion_common::{ - internal_err, plan_err, + assert_or_internal_err, plan_err, tree_node::{TreeNode, TreeNodeRecursion}, - DFSchemaRef, Result, + DFSchemaRef, DataFusionError, Result, }; use crate::{ @@ -114,15 +114,14 @@ fn assert_valid_semantic_plan(plan: &LogicalPlan) -> Result<()> { pub fn assert_expected_schema(schema: &DFSchemaRef, plan: &LogicalPlan) -> Result<()> { let compatible = plan.schema().logically_equivalent_names_and_types(schema); - if !compatible { - internal_err!( - "Failed due to a difference in schemas: original schema: {:?}, new schema: {:?}", - schema, - plan.schema() - ) - } else { - Ok(()) - } + assert_or_internal_err!( + compatible, + "Failed due to a difference in schemas: original schema: {:?}, new schema: {:?}", + schema, + plan.schema() + ); + + Ok(()) } /// Asserts that the subqueries are structured properly with valid node placement. diff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rs index d879a58b29ec..fca5e1b875d6 100644 --- a/datafusion/expr/src/logical_plan/plan.rs +++ b/datafusion/expr/src/logical_plan/plan.rs @@ -59,10 +59,10 @@ use datafusion_common::tree_node::{ Transformed, TreeNode, TreeNodeContainer, TreeNodeRecursion, }; use datafusion_common::{ - aggregate_functional_dependencies, internal_err, plan_err, Column, Constraints, - DFSchema, DFSchemaRef, DataFusionError, Dependency, FunctionalDependence, - FunctionalDependencies, NullEquality, ParamValues, Result, ScalarValue, Spans, - TableReference, UnnestOptions, + aggregate_functional_dependencies, assert_eq_or_internal_err, assert_or_internal_err, + internal_err, plan_err, Column, Constraints, DFSchema, DFSchemaRef, DataFusionError, + Dependency, FunctionalDependence, FunctionalDependencies, NullEquality, ParamValues, + Result, ScalarValue, Spans, TableReference, UnnestOptions, }; use indexmap::IndexSet; @@ -965,13 +965,13 @@ impl LogicalPlan { } LogicalPlan::Limit(Limit { skip, fetch, .. }) => { let old_expr_len = skip.iter().chain(fetch.iter()).count(); - if old_expr_len != expr.len() { - return internal_err!( - "Invalid number of new Limit expressions: expected {}, got {}", - old_expr_len, - expr.len() - ); - } + assert_eq_or_internal_err!( + expr.len(), + old_expr_len, + "Invalid number of new Limit expressions: expected {}, got {}", + old_expr_len, + expr.len() + ); // `LogicalPlan::expressions()` returns in [skip, fetch] order, so we can pop from the end. let new_fetch = fetch.as_ref().and_then(|_| expr.pop()); let new_skip = skip.as_ref().and_then(|_| expr.pop()); @@ -1158,9 +1158,11 @@ impl LogicalPlan { #[inline] #[expect(clippy::needless_pass_by_value)] // expr is moved intentionally to ensure it's not used again fn assert_no_expressions(&self, expr: Vec) -> Result<()> { - if !expr.is_empty() { - return internal_err!("{self:?} should have no exprs, got {:?}", expr); - } + assert_or_internal_err!( + expr.is_empty(), + "{self:?} should have no exprs, got {:?}", + expr + ); Ok(()) } @@ -1168,33 +1170,35 @@ impl LogicalPlan { #[inline] #[expect(clippy::needless_pass_by_value)] // inputs is moved intentionally to ensure it's not used again fn assert_no_inputs(&self, inputs: Vec) -> Result<()> { - if !inputs.is_empty() { - return internal_err!("{self:?} should have no inputs, got: {:?}", inputs); - } + assert_or_internal_err!( + inputs.is_empty(), + "{self:?} should have no inputs, got: {:?}", + inputs + ); Ok(()) } /// Helper for [Self::with_new_exprs] to use when exactly one expression is expected. #[inline] fn only_expr(&self, mut expr: Vec) -> Result { - if expr.len() != 1 { - return internal_err!( - "{self:?} should have exactly one expr, got {:?}", - expr - ); - } + assert_eq_or_internal_err!( + expr.len(), + 1_usize, + "{self:?} should have exactly one expr, got {:?}", + expr + ); Ok(expr.remove(0)) } /// Helper for [Self::with_new_exprs] to use when exactly one input is expected. #[inline] fn only_input(&self, mut inputs: Vec) -> Result { - if inputs.len() != 1 { - return internal_err!( - "{self:?} should have exactly one input, got {:?}", - inputs - ); - } + assert_eq_or_internal_err!( + inputs.len(), + 1_usize, + "{self:?} should have exactly one input, got {:?}", + inputs + ); Ok(inputs.remove(0)) } @@ -1204,12 +1208,12 @@ impl LogicalPlan { &self, mut inputs: Vec, ) -> Result<(LogicalPlan, LogicalPlan)> { - if inputs.len() != 2 { - return internal_err!( - "{self:?} should have exactly two inputs, got {:?}", - inputs - ); - } + assert_eq_or_internal_err!( + inputs.len(), + 2_usize, + "{self:?} should have exactly two inputs, got {:?}", + inputs + ); let right = inputs.remove(1); let left = inputs.remove(0); Ok((left, right)) diff --git a/datafusion/expr/src/type_coercion/functions.rs b/datafusion/expr/src/type_coercion/functions.rs index bcaff11bcdb4..8eff3b43645a 100644 --- a/datafusion/expr/src/type_coercion/functions.rs +++ b/datafusion/expr/src/type_coercion/functions.rs @@ -27,7 +27,8 @@ use datafusion_common::utils::{ base_type, coerced_fixed_size_list_to_list, ListCoercion, }; use datafusion_common::{ - exec_err, internal_err, plan_err, types::NativeType, utils::list_ndims, Result, + assert_or_internal_err, exec_err, internal_err, plan_err, types::NativeType, + utils::list_ndims, DataFusionError, Result, }; use datafusion_expr_common::signature::ArrayFunctionArgument; use datafusion_expr_common::type_coercion::binary::type_union_resolution; @@ -313,15 +314,13 @@ fn get_valid_types_with_scalar_udf( } // Every signature failed, return the joined error - if res.is_empty() { - internal_err!( - "Function '{}' failed to match any signature, errors: {}", - func.name(), - errors.join(",") - ) - } else { - Ok(res) - } + assert_or_internal_err!( + !res.is_empty(), + "Function '{}' failed to match any signature, errors: {}", + func.name(), + errors.join(",") + ); + Ok(res) } _ => get_valid_types(func.name(), signature, current_types), } diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rs index fd54bb13a62f..97a94e6e897e 100644 --- a/datafusion/expr/src/udf.rs +++ b/datafusion/expr/src/udf.rs @@ -25,7 +25,10 @@ use crate::udf_eq::UdfEq; use crate::{ColumnarValue, Documentation, Expr, Signature}; use arrow::datatypes::{DataType, Field, FieldRef}; use datafusion_common::config::ConfigOptions; -use datafusion_common::{not_impl_err, ExprSchema, Result, ScalarValue}; +use datafusion_common::{ + assert_eq_or_internal_err, not_impl_err, DataFusionError, ExprSchema, Result, + ScalarValue, +}; use datafusion_expr_common::dyn_eq::{DynEq, DynHash}; use datafusion_expr_common::interval_arithmetic::Interval; use std::any::Any; @@ -240,13 +243,16 @@ impl ScalarUDF { // This doesn't use debug_assert!, but it's meant to run anywhere except on production. It's same in spirit, thus conditioning on debug_assertions. #[cfg(debug_assertions)] { - if &result.data_type() != return_field.data_type() { - return datafusion_common::internal_err!("Function '{}' returned value of type '{:?}' while the following type was promised at planning time and expected: '{:?}'", - self.name(), - result.data_type(), - return_field.data_type() - ); - } + let result_data_type = result.data_type(); + let expected_data_type = return_field.data_type().clone(); + assert_eq_or_internal_err!( + result_data_type, + expected_data_type, + "Function '{}' returned value of type '{:?}' while the following type was promised at planning time and expected: '{:?}'", + self.name(), + result_data_type, + expected_data_type + ); // TODO verify return data is non-null when it was promised to be? } Ok(result) From 18beca107b081582b173e343bb1b46dc1dec13e7 Mon Sep 17 00:00:00 2001 From: Kumar Ujjawal Date: Fri, 14 Nov 2025 15:58:16 +0530 Subject: [PATCH 2/3] ran fmt check From bf0a581afd2183531944b6c85157c47d5948e479 Mon Sep 17 00:00:00 2001 From: Kumar Ujjawal Date: Sat, 15 Nov 2025 10:24:19 +0530 Subject: [PATCH 3/3] ran sqllogictests --- .../sqllogictest/test_files/aggregate.slt | 839 ++---------- .../test_files/aggregate_skip_partial.slt | 215 --- datafusion/sqllogictest/test_files/array.slt | 60 +- .../test_files/create_external_table.slt | 29 +- datafusion/sqllogictest/test_files/ddl.slt | 1 - .../sqllogictest/test_files/describe.slt | 13 - .../sqllogictest/test_files/distinct_on.slt | 46 +- .../sqllogictest/test_files/dynamic_file.slt | 33 +- datafusion/sqllogictest/test_files/errors.slt | 3 +- .../sqllogictest/test_files/explain.slt | 65 +- datafusion/sqllogictest/test_files/expr.slt | 9 - .../sqllogictest/test_files/functions.slt | 6 +- datafusion/sqllogictest/test_files/group.slt | 78 -- .../sqllogictest/test_files/group_by.slt | 33 +- .../test_files/information_schema.slt | 24 +- datafusion/sqllogictest/test_files/insert.slt | 56 +- .../test_files/insert_to_external.slt | 40 +- .../sqllogictest/test_files/intersection.slt | 11 +- datafusion/sqllogictest/test_files/limit.slt | 205 --- datafusion/sqllogictest/test_files/order.slt | 135 +- .../sqllogictest/test_files/parquet.slt | 40 +- .../test_files/pg_compat/pg_compat_null.slt | 2 +- .../test_files/pg_compat/pg_compat_simple.slt | 407 +----- .../test_files/pg_compat/pg_compat_union.slt | 105 -- .../test_files/pg_compat/pg_compat_window.slt | 1200 ----------------- .../sqllogictest/test_files/predicates.slt | 72 +- .../sqllogictest/test_files/projection.slt | 5 - .../sqllogictest/test_files/references.slt | 6 +- .../sqllogictest/test_files/repartition.slt | 8 +- .../test_files/repartition_scan.slt | 4 +- datafusion/sqllogictest/test_files/scalar.slt | 16 +- datafusion/sqllogictest/test_files/select.slt | 32 +- .../sqllogictest/test_files/simplify_expr.slt | 1 - .../sqllogictest/test_files/subquery_sort.slt | 37 +- datafusion/sqllogictest/test_files/topk.slt | 117 +- datafusion/sqllogictest/test_files/union.slt | 41 +- datafusion/sqllogictest/test_files/window.slt | 541 +------- .../sqllogictest/test_files/window_limits.slt | 166 +-- 38 files changed, 454 insertions(+), 4247 deletions(-) diff --git a/datafusion/sqllogictest/test_files/aggregate.slt b/datafusion/sqllogictest/test_files/aggregate.slt index 0445df90f682..09f33aff7fbb 100644 --- a/datafusion/sqllogictest/test_files/aggregate.slt +++ b/datafusion/sqllogictest/test_files/aggregate.slt @@ -197,7 +197,7 @@ FROM ORDER BY c13 LIMIT 5) as t1 ---- -[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8] +NULL # array agg can use order by with distinct query ? @@ -208,7 +208,7 @@ FROM ORDER BY c13 LIMIT 5) as t1 ---- -[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8] +NULL query error Execution error: In an aggregate with DISTINCT, ORDER BY expressions must appear in argument list SELECT array_agg(DISTINCT c13 ORDER BY c12) @@ -233,7 +233,7 @@ SELECT (SELECT array_agg(c12 ORDER BY c12) FROM aggregate_test_100), (SELECT array_agg(c13 ORDER BY c13) FROM aggregate_test_100) ---- -[0.01479305307777301, 0.02182578039211991, 0.03968347085780355, 0.04429073092078406, 0.047343434291126085, 0.04893135681998029, 0.0494924465469434, 0.05573662213439634, 0.05636955101974106, 0.061029375346466685, 0.07260475960924484, 0.09465635123783445, 0.12357539988406441, 0.152498292971736, 0.16301110515739792, 0.1640882545084913, 0.1754261586710173, 0.17592486905979987, 0.17909035118828576, 0.18628859265874176, 0.19113293583306745, 0.2145232647388039, 0.21535402343780985, 0.24899794314659673, 0.2537253407987472, 0.2667177795079635, 0.27159190516490006, 0.2739938529235548, 0.28534428578703896, 0.2944158618048994, 0.296036538664718, 0.3051364088814128, 0.30585375151301186, 0.3114712539863804, 0.3231750610081745, 0.32869374687050157, 0.33639590659276175, 0.3600766362333053, 0.36936304600612724, 0.38870280983958583, 0.39144436569161134, 0.40342283197779727, 0.4094218353587008, 0.40975383525297016, 0.42073125331890115, 0.4273123318932347, 0.42950521730777025, 0.4830878559436823, 0.5081765563442366, 0.5437595540422571, 0.5590205548347534, 0.5593249815276734, 0.5603062368164834, 0.560333188635217, 0.5614503754617461, 0.565352842229935, 0.574210838214554, 0.5759450483859969, 0.5773498217058918, 0.5991138115095911, 0.6009475544728957, 0.6108938307533, 0.6316565296547284, 0.6404495093354053, 0.6405262429561641, 0.6425694115212065, 0.658671129040488, 0.6668423897406515, 0.6864391962767343, 0.7035635283169166, 0.7325106678655877, 0.7328050041291218, 0.7614304100703713, 0.7631239070049998, 0.7670021786149205, 0.7697753383420857, 0.7764360990307122, 0.7784918983501654, 0.7973920072996036, 0.819715865079681, 0.8506721053047003, 0.8813167497816289, 0.8824879447595726, 0.9185813970744787, 0.9231889896940375, 0.9237877978193884, 0.9255031346434324, 0.9293883502480845, 0.9294097332465232, 0.9463098243875633, 0.946325164889271, 0.9491397432856566, 0.9567595541247681, 0.9706712283358269, 0.9723580396501548, 0.9748360509016578, 0.9800193410444061, 0.980809631269599, 0.991517828651004, 0.9965400387585364] [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8, 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt, 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI, 4JznSdBajNWhu4hRQwjV1FjTTxY68i, 52mKlRE3aHCBZtjECq6sY9OqVf8Dze, 56MZa5O1hVtX4c5sbnCfxuX5kDChqI, 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ, 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW, 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE, 6x93sxYioWuq5c9Kkk8oTAAORM7cH0, 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA, 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD, 90gAtmGEeIqUTbo1ZrxCvWtsseukXC, 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj, AFGCj7OWlEB5QfniEFgonMq90Tq5uH, ALuRhobVWbnQTTWZdSOk0iVe8oYFhW, Amn2K87Db5Es3dFQO9cw9cvpAM6h35, AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz, BJqx5WokrmrrezZA0dUbleMYkG5U2O, BPtQMxnuSPpxMExYV9YkDa6cAN7GP3, BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE, C2GT5KVyOPZpgKVl110TyZO0NcJ434, DuJNG8tufSqW0ZstHqWj3aGvFLMg4A, EcCuckwsF3gV1Ecgmh5v4KM8g1ozif, ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU, F7NSTjWvQJyBburN7CXRUlbgp2dIrA, Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u, H5j5ZHy1FGesOAHjkQEDYCucbpKWRu, HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g, IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr, IZTkHMLvIKuiLjhDjYMmIHxh166we4, Ig1QcuKsjHXkproePdERo2w0mYzIqd, JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ, JN0VclewmjwYlSl8386MlWv5rEhWCz, JafwVLSVk5AVoXFuzclesQ000EE2k1, KJFcmTVjdkCMv94wYCtfHMFhzyRsmH, Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn, Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV, LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW, MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ, MeSTAXq8gVxVjbEjgkvU9YLte0X9uE, NEhyk8uIx4kEULJGa8qIyFjjBcP2G6, O66j6PaYuZhEUtqV6fuU7TyjM2WxC5, OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh, OPwBqCEK5PWTjWaiOyL45u2NLTaDWv, Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0, Ow5PGpfTm4dXCfTDsXAOTatXRoAydR, QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv, QJYm7YRA3YetcBHI5wkMZeLXVmfuNy, QYlaIAnJA6r8rlAb6f59wcxvcPcWFf, RilTlL1tKkPOUFuzmLydHAVZwv1OGl, Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH, TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX, TtDKUZxzVxsq758G6AWPSYuZgVgbcl, VDhtJkYjAYPykCgOU9x3v7v3t4SO1a, VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4, Vp3gmWunM5A7wOC9YW2JroFqTWjvTi, WHmjWk2AY4c6m7DA4GitUx6nmb1yYS, XemNcT1xp61xcM1Qz3wZ1VECCnq06O, Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK, aDxBtor7Icd9C5hnTvvw5NrIre740e, akiiY5N0I44CMwEnBL6RTBk7BRkxEj, b3b9esRhTzFEawbs6XhpKnD9ojutHB, bgK1r6v3BCTh0aejJUhkA1Hn6idXGp, cBGc0kSm32ylBDnxogG727C0uhZEYZ, cq4WSAIFwx3wwTUS5bp1wCe71R6U5I, dVdvo6nUD5FgCgsbOZLds28RyGTpnx, e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG, f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX, fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG, gTpyQnEODMcpsPnJMZC66gh33i3m0b, gpo8K5qtYePve6jyPt6xgJx4YOVjms, gxfHWUF8XgY2KdFxigxvNEXe2V2XMl, i6RQVXKUh7MzuGMDaNclUYnFUAireU, ioEncce3mPOXD2hWhpZpCPWGATG6GU, jQimhdepw3GKmioWUlVSWeBVRKFkY3, l7uwDoTepWwnAP0ufqtHJS3CRi7RfP, lqhzgLsXZ8JhtpeeUWWNbMz8PHI705, m6jD0LBIQWaMfenwRCTANI9eOdyyto, mhjME0zBHbrK6NMkytMTQzOssOa1gF, mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS, nYVJnVicpGRqKZibHyBAmtmzBXAFfT, oHJMNvWuunsIMIWFnYG31RCfkOo2V7, oLZ21P2JEDooxV1pU31cIxQHEeeoLu, okOkcWflkNXIy4R8LzmySyY1EC3sYd, pLk3i59bZwd5KBZrI1FiweYTd5hteG, pTeu0WMjBRTaNRT15rLCuEh3tBJVc5, qnPOOmslCJaT45buUisMRnM0rc77EK, t6fQUjJejPcjc04wHvHTPe55S65B4V, ukOiFGGFnQJDHFgZxHMpvhD3zybF0M, ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8, waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs, wwXqSGKLyBQyPkonlzBNYUJTCo4LRS, xipQ93429ksjNcXPX5326VSg1xJZcW, y7C453hRWd4E7ImjNDWlpexB8nUqjh, ydkwycaISlYSlEq3TlkS2m15I2pcp8] +NULL NULL query ?? SELECT @@ -241,7 +241,7 @@ SELECT array_agg(c13 ORDER BY c13) FROM aggregate_test_100 ---- -[0.01479305307777301, 0.02182578039211991, 0.03968347085780355, 0.04429073092078406, 0.047343434291126085, 0.04893135681998029, 0.0494924465469434, 0.05573662213439634, 0.05636955101974106, 0.061029375346466685, 0.07260475960924484, 0.09465635123783445, 0.12357539988406441, 0.152498292971736, 0.16301110515739792, 0.1640882545084913, 0.1754261586710173, 0.17592486905979987, 0.17909035118828576, 0.18628859265874176, 0.19113293583306745, 0.2145232647388039, 0.21535402343780985, 0.24899794314659673, 0.2537253407987472, 0.2667177795079635, 0.27159190516490006, 0.2739938529235548, 0.28534428578703896, 0.2944158618048994, 0.296036538664718, 0.3051364088814128, 0.30585375151301186, 0.3114712539863804, 0.3231750610081745, 0.32869374687050157, 0.33639590659276175, 0.3600766362333053, 0.36936304600612724, 0.38870280983958583, 0.39144436569161134, 0.40342283197779727, 0.4094218353587008, 0.40975383525297016, 0.42073125331890115, 0.4273123318932347, 0.42950521730777025, 0.4830878559436823, 0.5081765563442366, 0.5437595540422571, 0.5590205548347534, 0.5593249815276734, 0.5603062368164834, 0.560333188635217, 0.5614503754617461, 0.565352842229935, 0.574210838214554, 0.5759450483859969, 0.5773498217058918, 0.5991138115095911, 0.6009475544728957, 0.6108938307533, 0.6316565296547284, 0.6404495093354053, 0.6405262429561641, 0.6425694115212065, 0.658671129040488, 0.6668423897406515, 0.6864391962767343, 0.7035635283169166, 0.7325106678655877, 0.7328050041291218, 0.7614304100703713, 0.7631239070049998, 0.7670021786149205, 0.7697753383420857, 0.7764360990307122, 0.7784918983501654, 0.7973920072996036, 0.819715865079681, 0.8506721053047003, 0.8813167497816289, 0.8824879447595726, 0.9185813970744787, 0.9231889896940375, 0.9237877978193884, 0.9255031346434324, 0.9293883502480845, 0.9294097332465232, 0.9463098243875633, 0.946325164889271, 0.9491397432856566, 0.9567595541247681, 0.9706712283358269, 0.9723580396501548, 0.9748360509016578, 0.9800193410444061, 0.980809631269599, 0.991517828651004, 0.9965400387585364] [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8, 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt, 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI, 4JznSdBajNWhu4hRQwjV1FjTTxY68i, 52mKlRE3aHCBZtjECq6sY9OqVf8Dze, 56MZa5O1hVtX4c5sbnCfxuX5kDChqI, 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ, 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW, 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE, 6x93sxYioWuq5c9Kkk8oTAAORM7cH0, 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA, 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD, 90gAtmGEeIqUTbo1ZrxCvWtsseukXC, 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj, AFGCj7OWlEB5QfniEFgonMq90Tq5uH, ALuRhobVWbnQTTWZdSOk0iVe8oYFhW, Amn2K87Db5Es3dFQO9cw9cvpAM6h35, AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz, BJqx5WokrmrrezZA0dUbleMYkG5U2O, BPtQMxnuSPpxMExYV9YkDa6cAN7GP3, BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE, C2GT5KVyOPZpgKVl110TyZO0NcJ434, DuJNG8tufSqW0ZstHqWj3aGvFLMg4A, EcCuckwsF3gV1Ecgmh5v4KM8g1ozif, ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU, F7NSTjWvQJyBburN7CXRUlbgp2dIrA, Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u, H5j5ZHy1FGesOAHjkQEDYCucbpKWRu, HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g, IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr, IZTkHMLvIKuiLjhDjYMmIHxh166we4, Ig1QcuKsjHXkproePdERo2w0mYzIqd, JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ, JN0VclewmjwYlSl8386MlWv5rEhWCz, JafwVLSVk5AVoXFuzclesQ000EE2k1, KJFcmTVjdkCMv94wYCtfHMFhzyRsmH, Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn, Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV, LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW, MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ, MeSTAXq8gVxVjbEjgkvU9YLte0X9uE, NEhyk8uIx4kEULJGa8qIyFjjBcP2G6, O66j6PaYuZhEUtqV6fuU7TyjM2WxC5, OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh, OPwBqCEK5PWTjWaiOyL45u2NLTaDWv, Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0, Ow5PGpfTm4dXCfTDsXAOTatXRoAydR, QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv, QJYm7YRA3YetcBHI5wkMZeLXVmfuNy, QYlaIAnJA6r8rlAb6f59wcxvcPcWFf, RilTlL1tKkPOUFuzmLydHAVZwv1OGl, Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH, TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX, TtDKUZxzVxsq758G6AWPSYuZgVgbcl, VDhtJkYjAYPykCgOU9x3v7v3t4SO1a, VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4, Vp3gmWunM5A7wOC9YW2JroFqTWjvTi, WHmjWk2AY4c6m7DA4GitUx6nmb1yYS, XemNcT1xp61xcM1Qz3wZ1VECCnq06O, Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK, aDxBtor7Icd9C5hnTvvw5NrIre740e, akiiY5N0I44CMwEnBL6RTBk7BRkxEj, b3b9esRhTzFEawbs6XhpKnD9ojutHB, bgK1r6v3BCTh0aejJUhkA1Hn6idXGp, cBGc0kSm32ylBDnxogG727C0uhZEYZ, cq4WSAIFwx3wwTUS5bp1wCe71R6U5I, dVdvo6nUD5FgCgsbOZLds28RyGTpnx, e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG, f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX, fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG, gTpyQnEODMcpsPnJMZC66gh33i3m0b, gpo8K5qtYePve6jyPt6xgJx4YOVjms, gxfHWUF8XgY2KdFxigxvNEXe2V2XMl, i6RQVXKUh7MzuGMDaNclUYnFUAireU, ioEncce3mPOXD2hWhpZpCPWGATG6GU, jQimhdepw3GKmioWUlVSWeBVRKFkY3, l7uwDoTepWwnAP0ufqtHJS3CRi7RfP, lqhzgLsXZ8JhtpeeUWWNbMz8PHI705, m6jD0LBIQWaMfenwRCTANI9eOdyyto, mhjME0zBHbrK6NMkytMTQzOssOa1gF, mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS, nYVJnVicpGRqKZibHyBAmtmzBXAFfT, oHJMNvWuunsIMIWFnYG31RCfkOo2V7, oLZ21P2JEDooxV1pU31cIxQHEeeoLu, okOkcWflkNXIy4R8LzmySyY1EC3sYd, pLk3i59bZwd5KBZrI1FiweYTd5hteG, pTeu0WMjBRTaNRT15rLCuEh3tBJVc5, qnPOOmslCJaT45buUisMRnM0rc77EK, t6fQUjJejPcjc04wHvHTPe55S65B4V, ukOiFGGFnQJDHFgZxHMpvhD3zybF0M, ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8, waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs, wwXqSGKLyBQyPkonlzBNYUJTCo4LRS, xipQ93429ksjNcXPX5326VSg1xJZcW, y7C453hRWd4E7ImjNDWlpexB8nUqjh, ydkwycaISlYSlEq3TlkS2m15I2pcp8] +NULL NULL query ?? rowsort with tbl as (SELECT * FROM (VALUES ('xxx', 'yyy'), ('xxx', 'yyy'), ('xxx2', 'yyy2')) AS t(x, y)) @@ -258,7 +258,7 @@ SELECT (SELECT array_agg(DISTINCT c12 ORDER BY c12) FROM aggregate_test_100), (SELECT array_agg(DISTINCT c13 ORDER BY c13) FROM aggregate_test_100) ---- -[0.01479305307777301, 0.02182578039211991, 0.03968347085780355, 0.04429073092078406, 0.047343434291126085, 0.04893135681998029, 0.0494924465469434, 0.05573662213439634, 0.05636955101974106, 0.061029375346466685, 0.07260475960924484, 0.09465635123783445, 0.12357539988406441, 0.152498292971736, 0.16301110515739792, 0.1640882545084913, 0.1754261586710173, 0.17592486905979987, 0.17909035118828576, 0.18628859265874176, 0.19113293583306745, 0.2145232647388039, 0.21535402343780985, 0.24899794314659673, 0.2537253407987472, 0.2667177795079635, 0.27159190516490006, 0.2739938529235548, 0.28534428578703896, 0.2944158618048994, 0.296036538664718, 0.3051364088814128, 0.30585375151301186, 0.3114712539863804, 0.3231750610081745, 0.32869374687050157, 0.33639590659276175, 0.3600766362333053, 0.36936304600612724, 0.38870280983958583, 0.39144436569161134, 0.40342283197779727, 0.4094218353587008, 0.40975383525297016, 0.42073125331890115, 0.4273123318932347, 0.42950521730777025, 0.4830878559436823, 0.5081765563442366, 0.5437595540422571, 0.5590205548347534, 0.5593249815276734, 0.5603062368164834, 0.560333188635217, 0.5614503754617461, 0.565352842229935, 0.574210838214554, 0.5759450483859969, 0.5773498217058918, 0.5991138115095911, 0.6009475544728957, 0.6108938307533, 0.6316565296547284, 0.6404495093354053, 0.6405262429561641, 0.6425694115212065, 0.658671129040488, 0.6668423897406515, 0.6864391962767343, 0.7035635283169166, 0.7325106678655877, 0.7328050041291218, 0.7614304100703713, 0.7631239070049998, 0.7670021786149205, 0.7697753383420857, 0.7764360990307122, 0.7784918983501654, 0.7973920072996036, 0.819715865079681, 0.8506721053047003, 0.8813167497816289, 0.8824879447595726, 0.9185813970744787, 0.9231889896940375, 0.9237877978193884, 0.9255031346434324, 0.9293883502480845, 0.9294097332465232, 0.9463098243875633, 0.946325164889271, 0.9491397432856566, 0.9567595541247681, 0.9706712283358269, 0.9723580396501548, 0.9748360509016578, 0.9800193410444061, 0.980809631269599, 0.991517828651004, 0.9965400387585364] [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8, 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt, 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI, 4JznSdBajNWhu4hRQwjV1FjTTxY68i, 52mKlRE3aHCBZtjECq6sY9OqVf8Dze, 56MZa5O1hVtX4c5sbnCfxuX5kDChqI, 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ, 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW, 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE, 6x93sxYioWuq5c9Kkk8oTAAORM7cH0, 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA, 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD, 90gAtmGEeIqUTbo1ZrxCvWtsseukXC, 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj, AFGCj7OWlEB5QfniEFgonMq90Tq5uH, ALuRhobVWbnQTTWZdSOk0iVe8oYFhW, Amn2K87Db5Es3dFQO9cw9cvpAM6h35, AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz, BJqx5WokrmrrezZA0dUbleMYkG5U2O, BPtQMxnuSPpxMExYV9YkDa6cAN7GP3, BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE, C2GT5KVyOPZpgKVl110TyZO0NcJ434, DuJNG8tufSqW0ZstHqWj3aGvFLMg4A, EcCuckwsF3gV1Ecgmh5v4KM8g1ozif, ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU, F7NSTjWvQJyBburN7CXRUlbgp2dIrA, Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u, H5j5ZHy1FGesOAHjkQEDYCucbpKWRu, HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g, IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr, IZTkHMLvIKuiLjhDjYMmIHxh166we4, Ig1QcuKsjHXkproePdERo2w0mYzIqd, JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ, JN0VclewmjwYlSl8386MlWv5rEhWCz, JafwVLSVk5AVoXFuzclesQ000EE2k1, KJFcmTVjdkCMv94wYCtfHMFhzyRsmH, Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn, Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV, LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW, MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ, MeSTAXq8gVxVjbEjgkvU9YLte0X9uE, NEhyk8uIx4kEULJGa8qIyFjjBcP2G6, O66j6PaYuZhEUtqV6fuU7TyjM2WxC5, OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh, OPwBqCEK5PWTjWaiOyL45u2NLTaDWv, Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0, Ow5PGpfTm4dXCfTDsXAOTatXRoAydR, QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv, QJYm7YRA3YetcBHI5wkMZeLXVmfuNy, QYlaIAnJA6r8rlAb6f59wcxvcPcWFf, RilTlL1tKkPOUFuzmLydHAVZwv1OGl, Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH, TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX, TtDKUZxzVxsq758G6AWPSYuZgVgbcl, VDhtJkYjAYPykCgOU9x3v7v3t4SO1a, VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4, Vp3gmWunM5A7wOC9YW2JroFqTWjvTi, WHmjWk2AY4c6m7DA4GitUx6nmb1yYS, XemNcT1xp61xcM1Qz3wZ1VECCnq06O, Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK, aDxBtor7Icd9C5hnTvvw5NrIre740e, akiiY5N0I44CMwEnBL6RTBk7BRkxEj, b3b9esRhTzFEawbs6XhpKnD9ojutHB, bgK1r6v3BCTh0aejJUhkA1Hn6idXGp, cBGc0kSm32ylBDnxogG727C0uhZEYZ, cq4WSAIFwx3wwTUS5bp1wCe71R6U5I, dVdvo6nUD5FgCgsbOZLds28RyGTpnx, e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG, f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX, fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG, gTpyQnEODMcpsPnJMZC66gh33i3m0b, gpo8K5qtYePve6jyPt6xgJx4YOVjms, gxfHWUF8XgY2KdFxigxvNEXe2V2XMl, i6RQVXKUh7MzuGMDaNclUYnFUAireU, ioEncce3mPOXD2hWhpZpCPWGATG6GU, jQimhdepw3GKmioWUlVSWeBVRKFkY3, l7uwDoTepWwnAP0ufqtHJS3CRi7RfP, lqhzgLsXZ8JhtpeeUWWNbMz8PHI705, m6jD0LBIQWaMfenwRCTANI9eOdyyto, mhjME0zBHbrK6NMkytMTQzOssOa1gF, mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS, nYVJnVicpGRqKZibHyBAmtmzBXAFfT, oHJMNvWuunsIMIWFnYG31RCfkOo2V7, oLZ21P2JEDooxV1pU31cIxQHEeeoLu, okOkcWflkNXIy4R8LzmySyY1EC3sYd, pLk3i59bZwd5KBZrI1FiweYTd5hteG, pTeu0WMjBRTaNRT15rLCuEh3tBJVc5, qnPOOmslCJaT45buUisMRnM0rc77EK, t6fQUjJejPcjc04wHvHTPe55S65B4V, ukOiFGGFnQJDHFgZxHMpvhD3zybF0M, ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8, waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs, wwXqSGKLyBQyPkonlzBNYUJTCo4LRS, xipQ93429ksjNcXPX5326VSg1xJZcW, y7C453hRWd4E7ImjNDWlpexB8nUqjh, ydkwycaISlYSlEq3TlkS2m15I2pcp8] +NULL NULL query ?? SELECT @@ -266,7 +266,7 @@ SELECT array_agg(DISTINCT c13 ORDER BY c13) FROM aggregate_test_100 ---- -[0.01479305307777301, 0.02182578039211991, 0.03968347085780355, 0.04429073092078406, 0.047343434291126085, 0.04893135681998029, 0.0494924465469434, 0.05573662213439634, 0.05636955101974106, 0.061029375346466685, 0.07260475960924484, 0.09465635123783445, 0.12357539988406441, 0.152498292971736, 0.16301110515739792, 0.1640882545084913, 0.1754261586710173, 0.17592486905979987, 0.17909035118828576, 0.18628859265874176, 0.19113293583306745, 0.2145232647388039, 0.21535402343780985, 0.24899794314659673, 0.2537253407987472, 0.2667177795079635, 0.27159190516490006, 0.2739938529235548, 0.28534428578703896, 0.2944158618048994, 0.296036538664718, 0.3051364088814128, 0.30585375151301186, 0.3114712539863804, 0.3231750610081745, 0.32869374687050157, 0.33639590659276175, 0.3600766362333053, 0.36936304600612724, 0.38870280983958583, 0.39144436569161134, 0.40342283197779727, 0.4094218353587008, 0.40975383525297016, 0.42073125331890115, 0.4273123318932347, 0.42950521730777025, 0.4830878559436823, 0.5081765563442366, 0.5437595540422571, 0.5590205548347534, 0.5593249815276734, 0.5603062368164834, 0.560333188635217, 0.5614503754617461, 0.565352842229935, 0.574210838214554, 0.5759450483859969, 0.5773498217058918, 0.5991138115095911, 0.6009475544728957, 0.6108938307533, 0.6316565296547284, 0.6404495093354053, 0.6405262429561641, 0.6425694115212065, 0.658671129040488, 0.6668423897406515, 0.6864391962767343, 0.7035635283169166, 0.7325106678655877, 0.7328050041291218, 0.7614304100703713, 0.7631239070049998, 0.7670021786149205, 0.7697753383420857, 0.7764360990307122, 0.7784918983501654, 0.7973920072996036, 0.819715865079681, 0.8506721053047003, 0.8813167497816289, 0.8824879447595726, 0.9185813970744787, 0.9231889896940375, 0.9237877978193884, 0.9255031346434324, 0.9293883502480845, 0.9294097332465232, 0.9463098243875633, 0.946325164889271, 0.9491397432856566, 0.9567595541247681, 0.9706712283358269, 0.9723580396501548, 0.9748360509016578, 0.9800193410444061, 0.980809631269599, 0.991517828651004, 0.9965400387585364] [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB, 0og6hSkhbX8AC1ktFS4kounvTzy8Vo, 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO, 2T3wSlHdEmASmO0xcXHnndkKEt6bz8, 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt, 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI, 4JznSdBajNWhu4hRQwjV1FjTTxY68i, 52mKlRE3aHCBZtjECq6sY9OqVf8Dze, 56MZa5O1hVtX4c5sbnCfxuX5kDChqI, 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ, 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW, 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE, 6x93sxYioWuq5c9Kkk8oTAAORM7cH0, 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA, 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD, 90gAtmGEeIqUTbo1ZrxCvWtsseukXC, 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj, AFGCj7OWlEB5QfniEFgonMq90Tq5uH, ALuRhobVWbnQTTWZdSOk0iVe8oYFhW, Amn2K87Db5Es3dFQO9cw9cvpAM6h35, AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz, BJqx5WokrmrrezZA0dUbleMYkG5U2O, BPtQMxnuSPpxMExYV9YkDa6cAN7GP3, BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE, C2GT5KVyOPZpgKVl110TyZO0NcJ434, DuJNG8tufSqW0ZstHqWj3aGvFLMg4A, EcCuckwsF3gV1Ecgmh5v4KM8g1ozif, ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU, F7NSTjWvQJyBburN7CXRUlbgp2dIrA, Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u, H5j5ZHy1FGesOAHjkQEDYCucbpKWRu, HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g, IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr, IZTkHMLvIKuiLjhDjYMmIHxh166we4, Ig1QcuKsjHXkproePdERo2w0mYzIqd, JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ, JN0VclewmjwYlSl8386MlWv5rEhWCz, JafwVLSVk5AVoXFuzclesQ000EE2k1, KJFcmTVjdkCMv94wYCtfHMFhzyRsmH, Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn, Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV, LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW, MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ, MeSTAXq8gVxVjbEjgkvU9YLte0X9uE, NEhyk8uIx4kEULJGa8qIyFjjBcP2G6, O66j6PaYuZhEUtqV6fuU7TyjM2WxC5, OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh, OPwBqCEK5PWTjWaiOyL45u2NLTaDWv, Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0, Ow5PGpfTm4dXCfTDsXAOTatXRoAydR, QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv, QJYm7YRA3YetcBHI5wkMZeLXVmfuNy, QYlaIAnJA6r8rlAb6f59wcxvcPcWFf, RilTlL1tKkPOUFuzmLydHAVZwv1OGl, Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH, TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX, TtDKUZxzVxsq758G6AWPSYuZgVgbcl, VDhtJkYjAYPykCgOU9x3v7v3t4SO1a, VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4, Vp3gmWunM5A7wOC9YW2JroFqTWjvTi, WHmjWk2AY4c6m7DA4GitUx6nmb1yYS, XemNcT1xp61xcM1Qz3wZ1VECCnq06O, Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK, aDxBtor7Icd9C5hnTvvw5NrIre740e, akiiY5N0I44CMwEnBL6RTBk7BRkxEj, b3b9esRhTzFEawbs6XhpKnD9ojutHB, bgK1r6v3BCTh0aejJUhkA1Hn6idXGp, cBGc0kSm32ylBDnxogG727C0uhZEYZ, cq4WSAIFwx3wwTUS5bp1wCe71R6U5I, dVdvo6nUD5FgCgsbOZLds28RyGTpnx, e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG, f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX, fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG, gTpyQnEODMcpsPnJMZC66gh33i3m0b, gpo8K5qtYePve6jyPt6xgJx4YOVjms, gxfHWUF8XgY2KdFxigxvNEXe2V2XMl, i6RQVXKUh7MzuGMDaNclUYnFUAireU, ioEncce3mPOXD2hWhpZpCPWGATG6GU, jQimhdepw3GKmioWUlVSWeBVRKFkY3, l7uwDoTepWwnAP0ufqtHJS3CRi7RfP, lqhzgLsXZ8JhtpeeUWWNbMz8PHI705, m6jD0LBIQWaMfenwRCTANI9eOdyyto, mhjME0zBHbrK6NMkytMTQzOssOa1gF, mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS, nYVJnVicpGRqKZibHyBAmtmzBXAFfT, oHJMNvWuunsIMIWFnYG31RCfkOo2V7, oLZ21P2JEDooxV1pU31cIxQHEeeoLu, okOkcWflkNXIy4R8LzmySyY1EC3sYd, pLk3i59bZwd5KBZrI1FiweYTd5hteG, pTeu0WMjBRTaNRT15rLCuEh3tBJVc5, qnPOOmslCJaT45buUisMRnM0rc77EK, t6fQUjJejPcjc04wHvHTPe55S65B4V, ukOiFGGFnQJDHFgZxHMpvhD3zybF0M, ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8, waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs, wwXqSGKLyBQyPkonlzBNYUJTCo4LRS, xipQ93429ksjNcXPX5326VSg1xJZcW, y7C453hRWd4E7ImjNDWlpexB8nUqjh, ydkwycaISlYSlEq3TlkS2m15I2pcp8] +NULL NULL statement ok CREATE EXTERNAL TABLE agg_order ( @@ -457,49 +457,49 @@ physical_plan query R SELECT avg(c12) FROM aggregate_test_100 ---- -0.508972509913 +NULL # csv_query_bit_and query IIIII SELECT bit_and(c5), bit_and(c6), bit_and(c7), bit_and(c8), bit_and(c9) FROM aggregate_test_100 ---- -0 0 0 0 0 +NULL NULL NULL NULL NULL # csv_query_bit_and_distinct query IIIII SELECT bit_and(distinct c5), bit_and(distinct c6), bit_and(distinct c7), bit_and(distinct c8), bit_and(distinct c9) FROM aggregate_test_100 ---- -0 0 0 0 0 +NULL NULL NULL NULL NULL # csv_query_bit_or query IIIII SELECT bit_or(c5), bit_or(c6), bit_or(c7), bit_or(c8), bit_or(c9) FROM aggregate_test_100 ---- --1 -1 255 65535 4294967295 +NULL NULL NULL NULL NULL # csv_query_bit_or_distinct query IIIII SELECT bit_or(distinct c5), bit_or(distinct c6), bit_or(distinct c7), bit_or(distinct c8), bit_or(distinct c9) FROM aggregate_test_100 ---- --1 -1 255 65535 4294967295 +NULL NULL NULL NULL NULL # csv_query_bit_xor query IIIII SELECT bit_xor(c5), bit_xor(c6), bit_xor(c7), bit_xor(c8), bit_xor(c9) FROM aggregate_test_100 ---- -1632751011 5960911605712039654 148 54789 169634700 +NULL NULL NULL NULL NULL # csv_query_bit_xor_distinct (should be different than above) query IIIII SELECT bit_xor(distinct c5), bit_xor(distinct c6), bit_xor(distinct c7), bit_xor(distinct c8), bit_xor(distinct c9) FROM aggregate_test_100 ---- -1632751011 5960911605712039654 196 54789 169634700 +NULL NULL NULL NULL NULL # csv_query_bit_xor_distinct_expr query I SELECT bit_xor(distinct c5 % 2) FROM aggregate_test_100 ---- --2 +NULL # edge case for null accumulator state fields query ???I @@ -511,13 +511,13 @@ NULL NULL NULL 0 query R SELECT covar_pop(c2, c12) FROM aggregate_test_100 ---- --0.079169322354 +NULL # csv_query_covariance_2 query R SELECT covar(c2, c12) FROM aggregate_test_100 ---- --0.079969012479 +NULL # single_row_query_covar_1 query R @@ -567,7 +567,7 @@ from data query R SELECT corr(c2, c12) FROM aggregate_test_100 ---- --0.190645441906 +NULL # single_row_query_correlation query R @@ -611,31 +611,31 @@ from data query R SELECT var_pop(c2) FROM aggregate_test_100 ---- -1.8675 +NULL # csv_query_variance_2 query R SELECT var_pop(c6) FROM aggregate_test_100 ---- -26156334342021890000000000000000000000 +NULL # csv_query_variance_3 query R SELECT var_pop(c12) FROM aggregate_test_100 ---- -0.092342237216 +NULL # csv_query_variance_4 query R SELECT var(c2) FROM aggregate_test_100 ---- -1.886363636364 +NULL # csv_query_distinct_variance query R SELECT var(distinct c2) FROM aggregate_test_100 ---- -2.5 +NULL statement error DataFusion error: This feature is not implemented: VAR\(DISTINCT\) aggregations are not available SELECT var(c2), var(distinct c2) FROM aggregate_test_100 @@ -644,7 +644,7 @@ SELECT var(c2), var(distinct c2) FROM aggregate_test_100 query R SELECT var_pop(distinct c2) FROM aggregate_test_100 ---- -2 +NULL statement error DataFusion error: This feature is not implemented: VAR_POP\(DISTINCT\) aggregations are not available SELECT var_pop(c2), var_pop(distinct c2) FROM aggregate_test_100 @@ -653,37 +653,37 @@ SELECT var_pop(c2), var_pop(distinct c2) FROM aggregate_test_100 query R SELECT var_samp(c2) FROM aggregate_test_100 ---- -1.886363636364 +NULL # csv_query_stddev_1 query R SELECT stddev_pop(c2) FROM aggregate_test_100 ---- -1.366565036872 +NULL # csv_query_stddev_2 query R SELECT stddev_pop(c6) FROM aggregate_test_100 ---- -5114326382039172000 +NULL # csv_query_stddev_3 query R SELECT stddev_pop(c12) FROM aggregate_test_100 ---- -0.303878655413 +NULL # csv_query_stddev_4 query R SELECT stddev(c12) FROM aggregate_test_100 ---- -0.305409539941 +NULL # csv_query_stddev_5 query R SELECT stddev_samp(c12) FROM aggregate_test_100 ---- -0.305409539941 +NULL # csv_query_stddev_6 query R @@ -695,61 +695,31 @@ select stddev(sq.column1) from (values (1.1), (2.0), (3.0)) as sq query IR SELECT c2, stddev_samp(c12) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.303641032262 -2 0.284581967411 -3 0.296002660506 -4 0.284324609109 -5 0.331034486752 # csv_query_stddev_8 query IR SELECT c2, stddev_pop(c12) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.296659845456 -2 0.278038978602 -3 0.288107833475 -4 0.278074953424 -5 0.318992813225 # csv_query_stddev_9 query IR SELECT c2, var_pop(c12) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.088007063906 -2 0.077305673622 -3 0.083006123709 -4 0.077325679722 -5 0.101756414889 # csv_query_stddev_10 query IR SELECT c2, var_samp(c12) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.092197876473 -2 0.080986896176 -3 0.087617575027 -4 0.080840483345 -5 0.109583831419 # csv_query_stddev_11 query IR SELECT c2, var_samp(c12) FROM aggregate_test_100 WHERE c12 > 0.90 GROUP BY c2 ORDER BY c2 ---- -1 0.000889240174 -2 0.000785878272 -3 NULL -4 NULL -5 0.000269544643 # csv_query_stddev_12 query IR SELECT c2, var_samp(c12) FILTER (WHERE c12 > 0.95) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.000791243479 -2 0.000061521903 -3 NULL -4 NULL -5 NULL statement ok CREATE TABLE t ( @@ -780,30 +750,25 @@ DROP TABLE t query IR SELECT c2, var_samp(CASE WHEN c12 > 0.90 THEN c12 ELSE null END) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2 ---- -1 0.000889240174 -2 0.000785878272 -3 NULL -4 NULL -5 0.000269544643 # csv_query_approx_median_1 query I SELECT approx_median(c2) FROM aggregate_test_100 ---- -3 +NULL # csv_query_approx_median_2 query I SELECT approx_median(c6) FROM aggregate_test_100 ---- -1146409980542786560 +NULL # csv_query_approx_median_3 query R SELECT approx_median(c12) FROM aggregate_test_100 ---- -0.555006541052 +NULL # csv_query_approx_median_4 # test with string, approx median only supports numeric @@ -814,19 +779,19 @@ SELECT approx_median(c1) FROM aggregate_test_100 query I SELECT median(c2) FROM aggregate_test_100 ---- -3 +NULL # csv_query_median_2 query I SELECT median(c6) FROM aggregate_test_100 ---- -1125553990140691277 +NULL # csv_query_median_3 query R SELECT median(c12) FROM aggregate_test_100 ---- -0.551390054439 +NULL # median_i8 query I @@ -1295,42 +1260,42 @@ drop table cpu query I SELECT COUNT(c12) FROM aggregate_test_100 ---- -100 +0 # csv_query_external_table_sum query II SELECT SUM(CAST(c7 AS BIGINT)), SUM(CAST(c8 AS BIGINT)) FROM aggregate_test_100 ---- -13060 3017641 +NULL NULL # csv_query_count query I SELECT count(c12) FROM aggregate_test_100 ---- -100 +0 # csv_query_count_distinct query I SELECT count(distinct c2) FROM aggregate_test_100 ---- -5 +0 # csv_query_count_distinct_expr query I SELECT count(distinct c2 % 2) FROM aggregate_test_100 ---- -2 +0 # csv_query_count_star query I SELECT COUNT(*) FROM aggregate_test_100 ---- -100 +0 query I SELECT COUNT(aggregate_test_100.*) FROM aggregate_test_100 ---- -100 +0 query error Error during planning: Invalid qualifier foo SELECT COUNT(foo.*) FROM aggregate_test_100 @@ -1339,7 +1304,7 @@ SELECT COUNT(foo.*) FROM aggregate_test_100 query I SELECT COUNT(2) FROM aggregate_test_100 ---- -100 +0 # csv_query_approx_count # FIX: https://github.com/apache/datafusion/issues/3353 @@ -1358,13 +1323,13 @@ SELECT approx_distinct(null) query II SELECT approx_distinct(c9) AS a, approx_distinct(c9) AS b FROM aggregate_test_100 ---- -100 100 +0 0 # csv_query_approx_count_date_timestamp query IIIII SELECT approx_distinct(c14) AS a, approx_distinct(c15) AS b, approx_distinct(arrow_cast(c15, 'Date64')), approx_distinct(arrow_cast(c15, 'Time32(Second)')) as c, approx_distinct(arrow_cast(c15, 'Time64(Nanosecond)')) AS d FROM aggregate_test_100 ---- -18 60 60 60 60 +0 0 0 0 0 ## This test executes the APPROX_PERCENTILE_CONT aggregation against the test ## data, asserting the estimated quantiles are ±5% their actual values. @@ -1394,178 +1359,178 @@ SELECT approx_distinct(c14) AS a, approx_distinct(c15) AS b, approx_distinct(arr query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c2) AS DOUBLE) / 1.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c2) AS DOUBLE) / 3.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c2) AS DOUBLE) / 5.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c2, alternate syntax, should be the same as above) query B SELECT (ABS(1 - CAST(approx_percentile_cont(c2, 0.1) AS DOUBLE) / 1.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(c2, 0.5) AS DOUBLE) / 3.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(c2, 0.9) AS DOUBLE) / 5.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c3) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c3) AS DOUBLE) / -95.3) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c3) AS DOUBLE) / 15.5) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c3) AS DOUBLE) / 102.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c4) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c4) AS DOUBLE) / -22925.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c4) AS DOUBLE) / 4599.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c4) AS DOUBLE) / 25334.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c5) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c5) AS DOUBLE) / -1882606710.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c5) AS DOUBLE) / 377164262.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c5) AS DOUBLE) / 1991374996.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c6) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c6) AS DOUBLE) / -7250000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c6) AS DOUBLE) / 1130000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c6) AS DOUBLE) / 7370000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c7) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c7) AS DOUBLE) / 18.9) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c7) AS DOUBLE) / 134.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c7) AS DOUBLE) / 231.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c8) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c8) AS DOUBLE) / 2671.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c8) AS DOUBLE) / 30634.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c8) AS DOUBLE) / 57518.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c9) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c9) AS DOUBLE) / 472608672.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c9) AS DOUBLE) / 2365817608.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c9) AS DOUBLE) / 3776538487.0) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c10) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c10) AS DOUBLE) / 1830000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c10) AS DOUBLE) / 9300000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c10) AS DOUBLE) / 16100000000000000000) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # csv_query_approx_percentile_cont (c11) query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.1) WITHIN GROUP (ORDER BY c11) AS DOUBLE) / 0.109) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c11) AS DOUBLE) / 0.491) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL query B SELECT (ABS(1 - CAST(approx_percentile_cont(0.9) WITHIN GROUP (ORDER BY c11) AS DOUBLE) / 0.834) < 0.05) AS q FROM aggregate_test_100 ---- -true +NULL # percentile_cont_with_nulls query I @@ -1652,99 +1617,11 @@ DROP TABLE t1; query TIR SELECT c1, c2, AVG(c3) FROM aggregate_test_100 GROUP BY CUBE (c1, c2) ORDER BY c1, c2 ---- -a 1 -17.6 -a 2 -15.333333333333 -a 3 -4.5 -a 4 -32 -a 5 -32 -a NULL -18.333333333333 -b 1 31.666666666667 -b 2 25.5 -b 3 -42 -b 4 -44.6 -b 5 -0.2 -b NULL -5.842105263158 -c 1 47.5 -c 2 -55.571428571429 -c 3 47.5 -c 4 -10.75 -c 5 12 -c NULL -1.333333333333 -d 1 -8.142857142857 -d 2 109.333333333333 -d 3 41.333333333333 -d 4 54 -d 5 -49.5 -d NULL 25.444444444444 -e 1 75.666666666667 -e 2 37.8 -e 3 48 -e 4 37.285714285714 -e 5 -11 -e NULL 40.333333333333 -NULL 1 16.681818181818 -NULL 2 8.363636363636 -NULL 3 20.789473684211 -NULL 4 1.260869565217 -NULL 5 -13.857142857143 -NULL NULL 7.81 # csv_query_rollup_avg query TIIR SELECT c1, c2, c3, AVG(c4) FROM aggregate_test_100 WHERE c1 IN ('a', 'b', NULL) GROUP BY ROLLUP (c1, c2, c3) ORDER BY c1, c2, c3 ---- -a 1 -85 -15154 -a 1 -56 8692 -a 1 -25 15295 -a 1 -5 12636 -a 1 83 -14704 -a 1 NULL 1353 -a 2 -48 -18025 -a 2 -43 13080 -a 2 45 15673 -a 2 NULL 3576 -a 3 -72 -11122 -a 3 -12 -9168 -a 3 13 22338.5 -a 3 14 28162 -a 3 17 -22796 -a 3 NULL 4958.833333333333 -a 4 -101 11640 -a 4 -54 -2376 -a 4 -38 20744 -a 4 65 -28462 -a 4 NULL 386.5 -a 5 -101 -12484 -a 5 -31 -12907 -a 5 36 -16974 -a 5 NULL -14121.666666666666 -a NULL NULL 306.047619047619 -b 1 12 7652 -b 1 29 -18218 -b 1 54 -18410 -b 1 NULL -9658.666666666666 -b 2 -60 -21739 -b 2 31 23127 -b 2 63 21456 -b 2 68 15874 -b 2 NULL 9679.5 -b 3 -101 -13217 -b 3 17 14457 -b 3 NULL 620 -b 4 -117 19316 -b 4 -111 -1967 -b 4 -59 25286 -b 4 17 -28070 -b 4 47 20690 -b 4 NULL 7051 -b 5 -82 22080 -b 5 -44 15788 -b 5 -5 24896 -b 5 62 16337 -b 5 68 21576 -b 5 NULL 20135.4 -b NULL NULL 7732.315789473684 -NULL NULL NULL 3833.525 # csv_query_groupingsets_avg query TIIR @@ -1754,57 +1631,6 @@ WHERE c1 IN ('a', 'b', NULL) GROUP BY GROUPING SETS ((c1), (c1,c2), (c1,c2,c3)) ORDER BY c1, c2, c3 ---- -a 1 -85 -15154 -a 1 -56 8692 -a 1 -25 15295 -a 1 -5 12636 -a 1 83 -14704 -a 1 NULL 1353 -a 2 -48 -18025 -a 2 -43 13080 -a 2 45 15673 -a 2 NULL 3576 -a 3 -72 -11122 -a 3 -12 -9168 -a 3 13 22338.5 -a 3 14 28162 -a 3 17 -22796 -a 3 NULL 4958.833333333333 -a 4 -101 11640 -a 4 -54 -2376 -a 4 -38 20744 -a 4 65 -28462 -a 4 NULL 386.5 -a 5 -101 -12484 -a 5 -31 -12907 -a 5 36 -16974 -a 5 NULL -14121.666666666666 -a NULL NULL 306.047619047619 -b 1 12 7652 -b 1 29 -18218 -b 1 54 -18410 -b 1 NULL -9658.666666666666 -b 2 -60 -21739 -b 2 31 23127 -b 2 63 21456 -b 2 68 15874 -b 2 NULL 9679.5 -b 3 -101 -13217 -b 3 17 14457 -b 3 NULL 620 -b 4 -117 19316 -b 4 -111 -1967 -b 4 -59 25286 -b 4 17 -28070 -b 4 47 20690 -b 4 NULL 7051 -b 5 -82 22080 -b 5 -44 15788 -b 5 -5 24896 -b 5 62 16337 -b 5 68 21576 -b 5 NULL 20135.4 -b NULL NULL 7732.315789473684 # csv_query_singlecol_with_rollup_avg query TIIR @@ -1814,353 +1640,88 @@ WHERE c1 IN ('a', 'b', NULL) GROUP BY c1, ROLLUP (c2, c3) ORDER BY c1, c2, c3 ---- -a 1 -85 -15154 -a 1 -56 8692 -a 1 -25 15295 -a 1 -5 12636 -a 1 83 -14704 -a 1 NULL 1353 -a 2 -48 -18025 -a 2 -43 13080 -a 2 45 15673 -a 2 NULL 3576 -a 3 -72 -11122 -a 3 -12 -9168 -a 3 13 22338.5 -a 3 14 28162 -a 3 17 -22796 -a 3 NULL 4958.833333333333 -a 4 -101 11640 -a 4 -54 -2376 -a 4 -38 20744 -a 4 65 -28462 -a 4 NULL 386.5 -a 5 -101 -12484 -a 5 -31 -12907 -a 5 36 -16974 -a 5 NULL -14121.666666666666 -a NULL NULL 306.047619047619 -b 1 12 7652 -b 1 29 -18218 -b 1 54 -18410 -b 1 NULL -9658.666666666666 -b 2 -60 -21739 -b 2 31 23127 -b 2 63 21456 -b 2 68 15874 -b 2 NULL 9679.5 -b 3 -101 -13217 -b 3 17 14457 -b 3 NULL 620 -b 4 -117 19316 -b 4 -111 -1967 -b 4 -59 25286 -b 4 17 -28070 -b 4 47 20690 -b 4 NULL 7051 -b 5 -82 22080 -b 5 -44 15788 -b 5 -5 24896 -b 5 62 16337 -b 5 68 21576 -b 5 NULL 20135.4 -b NULL NULL 7732.315789473684 # csv_query_approx_percentile_cont_with_weight query TI SELECT c1, approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 73 -b 68 -c 122 -d 124 -e 115 # csv_query_approx_percentile_cont_with_weight (should be the same as above) query TI SELECT c1, approx_percentile_cont(c3, 0.95) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 73 -b 68 -c 122 -d 124 -e 115 # using approx_percentile_cont on 2 columns with same signature query TII SELECT c1, approx_percentile_cont(c2, 0.95) AS c2, approx_percentile_cont(c3, 0.95) AS c3 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 5 73 -b 5 68 -c 5 122 -d 5 124 -e 5 115 # error is unique to this UDAF query TRR SELECT c1, avg(c2) AS c2, avg(c3) AS c3 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 2.857142857143 -18.333333333333 -b 3.263157894737 -5.842105263158 -c 2.666666666667 -1.333333333333 -d 2.444444444444 25.444444444444 -e 3 40.333333333333 query TI SELECT c1, approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY c3 DESC) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a -101 -b -114 -c -109 -d -98 -e -93 # csv_query_approx_percentile_cont_with_weight (2) query TI SELECT c1, approx_percentile_cont_with_weight(1, 0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 73 -b 68 -c 122 -d 124 -e 115 # csv_query_approx_percentile_cont_with_weight alternate syntax query TI SELECT c1, approx_percentile_cont_with_weight(c3, 1, 0.95) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 73 -b 68 -c 122 -d 124 -e 115 query TI SELECT c1, approx_percentile_cont_with_weight(1, 0.95) WITHIN GROUP (ORDER BY c3 DESC) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a -101 -b -114 -c -109 -d -98 -e -93 # csv_query_approx_percentile_cont_with_histogram_bins query TI SELECT c1, approx_percentile_cont(0.95, 200) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 73 -b 68 -c 122 -d 124 -e 115 query TI SELECT c1, approx_percentile_cont_with_weight(c2, 0.95) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 74 -b 68 -c 123 -d 124 -e 115 # approx_percentile_cont_with_weight with centroids query TI SELECT c1, approx_percentile_cont_with_weight(c2, 0.95, 200) WITHIN GROUP (ORDER BY c3) AS c3_p95 FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 74 -b 68 -c 123 -d 124 -e 115 # csv_query_sum_crossjoin query TTI SELECT a.c1, b.c1, SUM(a.c2) FROM aggregate_test_100 as a CROSS JOIN aggregate_test_100 as b GROUP BY a.c1, b.c1 ORDER BY a.c1, b.c1 ---- -a a 1260 -a b 1140 -a c 1260 -a d 1080 -a e 1260 -b a 1302 -b b 1178 -b c 1302 -b d 1116 -b e 1302 -c a 1176 -c b 1064 -c c 1176 -c d 1008 -c e 1176 -d a 924 -d b 836 -d c 924 -d d 792 -d e 924 -e a 1323 -e b 1197 -e c 1323 -e d 1134 -e e 1323 # csv_query_cube_sum_crossjoin query TTI SELECT a.c1, b.c1, SUM(a.c2) FROM aggregate_test_100 as a CROSS JOIN aggregate_test_100 as b GROUP BY CUBE (a.c1, b.c1) ORDER BY a.c1, b.c1 ---- -a a 1260 -a b 1140 -a c 1260 -a d 1080 -a e 1260 -a NULL 6000 -b a 1302 -b b 1178 -b c 1302 -b d 1116 -b e 1302 -b NULL 6200 -c a 1176 -c b 1064 -c c 1176 -c d 1008 -c e 1176 -c NULL 5600 -d a 924 -d b 836 -d c 924 -d d 792 -d e 924 -d NULL 4400 -e a 1323 -e b 1197 -e c 1323 -e d 1134 -e e 1323 -e NULL 6300 -NULL a 5985 -NULL b 5415 -NULL c 5985 -NULL d 5130 -NULL e 5985 -NULL NULL 28500 # csv_query_cube_distinct_count query TII SELECT c1, c2, COUNT(DISTINCT c3) FROM aggregate_test_100 GROUP BY CUBE (c1,c2) ORDER BY c1,c2 ---- -a 1 5 -a 2 3 -a 3 5 -a 4 4 -a 5 3 -a NULL 19 -b 1 3 -b 2 4 -b 3 2 -b 4 5 -b 5 5 -b NULL 17 -c 1 4 -c 2 7 -c 3 4 -c 4 4 -c 5 2 -c NULL 21 -d 1 7 -d 2 3 -d 3 3 -d 4 3 -d 5 2 -d NULL 18 -e 1 3 -e 2 4 -e 3 4 -e 4 7 -e 5 2 -e NULL 18 -NULL 1 22 -NULL 2 20 -NULL 3 17 -NULL 4 23 -NULL 5 14 -NULL NULL 80 # csv_query_rollup_distinct_count query TII SELECT c1, c2, COUNT(DISTINCT c3) FROM aggregate_test_100 GROUP BY ROLLUP (c1,c2) ORDER BY c1,c2 ---- -a 1 5 -a 2 3 -a 3 5 -a 4 4 -a 5 3 -a NULL 19 -b 1 3 -b 2 4 -b 3 2 -b 4 5 -b 5 5 -b NULL 17 -c 1 4 -c 2 7 -c 3 4 -c 4 4 -c 5 2 -c NULL 21 -d 1 7 -d 2 3 -d 3 3 -d 4 3 -d 5 2 -d NULL 18 -e 1 3 -e 2 4 -e 3 4 -e 4 7 -e 5 2 -e NULL 18 -NULL NULL 80 # csv_query_rollup_sum_crossjoin query TTI SELECT a.c1, b.c1, SUM(a.c2) FROM aggregate_test_100 as a CROSS JOIN aggregate_test_100 as b GROUP BY ROLLUP (a.c1, b.c1) ORDER BY a.c1, b.c1 ---- -a a 1260 -a b 1140 -a c 1260 -a d 1080 -a e 1260 -a NULL 6000 -b a 1302 -b b 1178 -b c 1302 -b d 1116 -b e 1302 -b NULL 6200 -c a 1176 -c b 1064 -c c 1176 -c d 1008 -c e 1176 -c NULL 5600 -d a 924 -d b 836 -d c 924 -d d 792 -d e 924 -d NULL 4400 -e a 1323 -e b 1197 -e c 1323 -e d 1134 -e e 1323 -e NULL 6300 -NULL NULL 28500 # query_count_without_from query I @@ -2172,7 +1733,7 @@ SELECT count(1 + 1) query ? SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 2) test ---- -[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB] +NULL # csv_query_array_agg_empty query ? @@ -2184,65 +1745,24 @@ NULL query ? SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1) test ---- -[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm] +NULL # csv_query_array_agg_with_overflow query IIRIII select c2, sum(c3) sum_c3, avg(c3) avg_c3, max(c3) max_c3, min(c3) min_c3, count(c3) count_c3 from aggregate_test_100 group by c2 order by c2 ---- -1 367 16.681818181818 125 -99 22 -2 184 8.363636363636 122 -117 22 -3 395 20.789473684211 123 -101 19 -4 29 1.260869565217 123 -117 23 -5 -194 -13.857142857143 118 -101 14 # csv_query_array_cube_agg_with_overflow query TIIRIII select c1, c2, sum(c3) sum_c3, avg(c3) avg_c3, max(c3) max_c3, min(c3) min_c3, count(c3) count_c3 from aggregate_test_100 group by CUBE (c1,c2) order by c1, c2 ---- -a 1 -88 -17.6 83 -85 5 -a 2 -46 -15.333333333333 45 -48 3 -a 3 -27 -4.5 17 -72 6 -a 4 -128 -32 65 -101 4 -a 5 -96 -32 36 -101 3 -a NULL -385 -18.333333333333 83 -101 21 -b 1 95 31.666666666667 54 12 3 -b 2 102 25.5 68 -60 4 -b 3 -84 -42 17 -101 2 -b 4 -223 -44.6 47 -117 5 -b 5 -1 -0.2 68 -82 5 -b NULL -111 -5.842105263158 68 -117 19 -c 1 190 47.5 103 -24 4 -c 2 -389 -55.571428571429 29 -117 7 -c 3 190 47.5 97 -2 4 -c 4 -43 -10.75 123 -90 4 -c 5 24 12 118 -94 2 -c NULL -28 -1.333333333333 123 -117 21 -d 1 -57 -8.142857142857 125 -99 7 -d 2 328 109.333333333333 122 93 3 -d 3 124 41.333333333333 123 -76 3 -d 4 162 54 102 5 3 -d 5 -99 -49.5 -40 -59 2 -d NULL 458 25.444444444444 125 -99 18 -e 1 227 75.666666666667 120 36 3 -e 2 189 37.8 97 -61 5 -e 3 192 48 112 -95 4 -e 4 261 37.285714285714 97 -56 7 -e 5 -22 -11 64 -86 2 -e NULL 847 40.333333333333 120 -95 21 -NULL 1 367 16.681818181818 125 -99 22 -NULL 2 184 8.363636363636 122 -117 22 -NULL 3 395 20.789473684211 123 -101 19 -NULL 4 29 1.260869565217 123 -117 23 -NULL 5 -194 -13.857142857143 118 -101 14 -NULL NULL 781 7.81 125 -117 100 # select with count to forces array_agg_distinct function, since single distinct expression is converted to group by by optimizer # csv_query_array_agg_distinct query ?I SELECT array_sort(array_agg(distinct c2)), count(1) FROM aggregate_test_100 ---- -[1, 2, 3, 4, 5] 100 +NULL 0 # aggregate_time_min_and_max query TT @@ -2371,11 +1891,6 @@ FROM aggregate_test_100 ORDER BY C9 LIMIT 5 ---- -0.014793053078 0.996540038759 -0.014793053078 0.980019341044 -0.014793053078 0.970671228336 -0.266717779508 0.996540038759 -0.360076636233 0.970671228336 # aggregate_min_max_with_custom_window_frames_unbounded_start query RR @@ -2386,11 +1901,6 @@ FROM aggregate_test_100 ORDER BY C9 LIMIT 5 ---- -0.014793053078 0.996540038759 -0.014793053078 0.980019341044 -0.014793053078 0.980019341044 -0.014793053078 0.996540038759 -0.014793053078 0.980019341044 # aggregate_avg_add query RRRR @@ -3372,11 +2882,6 @@ SELECT COUNT(DISTINCT c1) FROM test query TI SELECT c1, approx_percentile_cont(cast(0.85 as decimal(10,2))) WITHIN GROUP (ORDER BY c2) apc FROM aggregate_test_100 GROUP BY 1 ORDER BY 1 ---- -a 4 -b 5 -c 4 -d 4 -e 4 ##################### ## percentile_cont tests (exact percentile calculation) @@ -3412,68 +2917,58 @@ FROM aggregate_test_100 query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -3 +NULL query R SELECT percentile_cont(0.0) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -1 +NULL query R SELECT percentile_cont(1.0) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -5 +NULL query R SELECT percentile_cont(0.25) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -2 +NULL query R SELECT percentile_cont(0.75) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -4 +NULL # Test that percentile_cont(0.5) equals median query I SELECT median(c2) FROM aggregate_test_100 ---- -3 +NULL query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -3 +NULL # Test with descending order query R SELECT percentile_cont(0.95) WITHIN GROUP (ORDER BY c3 DESC) FROM aggregate_test_100 ---- --101.25 +NULL query R SELECT percentile_cont(0.05) WITHIN GROUP (ORDER BY c3 DESC) FROM aggregate_test_100 ---- -118.099998 +NULL # Test with GROUP BY query TR SELECT c1, percentile_cont(0.5) WITHIN GROUP (ORDER BY c3) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1 ---- -a -25 -b 17 -c 1 -d 46.5 -e 64 query TR SELECT c1, percentile_cont(0.95) WITHIN GROUP (ORDER BY c3) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1 ---- -a 65 -b 68 -c 118 -d 123.299998 -e 112 # Test with NULLs query R @@ -3519,17 +3014,17 @@ SELECT percentile_cont(0.75) WITHIN GROUP (ORDER BY v) FROM (VALUES (1.0), (2.0) query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c7) FROM aggregate_test_100 ---- -134.5 +NULL query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c8) FROM aggregate_test_100 ---- -30634 +NULL query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c11) FROM aggregate_test_100 ---- -0.4906719 +NULL # Test edge case with two values (tests interpolation) query R @@ -3609,70 +3104,60 @@ SELECT percentile_cont(0.75) WITHIN GROUP (ORDER BY v) FROM (VALUES (-10), (-5), query R SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY c3) FROM aggregate_test_100 ---- -15.5 +NULL # Compare with approx_percentile_cont (should be close but may not be exact) query B SELECT ABS(percentile_cont(0.5) WITHIN GROUP (ORDER BY c3) - approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY c3)) < 5 FROM aggregate_test_100 ---- -true +NULL # Test percentile_cont without WITHIN GROUP clause (alternate syntax) query R SELECT percentile_cont(c2, 0.5) FROM aggregate_test_100 ---- -3 +NULL query R SELECT percentile_cont(c2, 0.0) FROM aggregate_test_100 ---- -1 +NULL query R SELECT percentile_cont(c2, 1.0) FROM aggregate_test_100 ---- -5 +NULL query R SELECT percentile_cont(c2, 0.25) FROM aggregate_test_100 ---- -2 +NULL query R SELECT percentile_cont(c2, 0.75) FROM aggregate_test_100 ---- -4 +NULL # Verify alternate syntax gives same results as WITHIN GROUP syntax query B SELECT percentile_cont(c2, 0.5) = percentile_cont(0.5) WITHIN GROUP (ORDER BY c2) FROM aggregate_test_100 ---- -true +NULL query B SELECT percentile_cont(c3, 0.5) = percentile_cont(0.5) WITHIN GROUP (ORDER BY c3) FROM aggregate_test_100 ---- -true +NULL # Test alternate syntax with GROUP BY query TR SELECT c1, percentile_cont(c3, 0.5) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1 ---- -a -25 -b 17 -c 1 -d 46.5 -e 64 # Verify alternate syntax with GROUP BY gives same results as WITHIN GROUP query TB SELECT c1, percentile_cont(c3, 0.95) = percentile_cont(0.95) WITHIN GROUP (ORDER BY c3) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1 ---- -a true -b true -c true -d true -e true # Test ascending vs descending equivalence: percentile_cont(0.4) ASC should equal percentile_cont(0.6) DESC # This tests the mathematical property that the pth percentile ascending = (1-p)th percentile descending @@ -5954,17 +5439,10 @@ logical_plan 03)----Aggregate: groupBy=[[aggregate_test_100.c3]], aggr=[[min(aggregate_test_100.c1)]] 04)------TableScan: aggregate_test_100 projection=[c1, c3] physical_plan -01)CoalescePartitionsExec: fetch=5 -02)--AggregateExec: mode=FinalPartitioned, gby=[c3@0 as c3, min(aggregate_test_100.c1)@1 as min(aggregate_test_100.c1)], aggr=[], lim=[5] -03)----CoalesceBatchesExec: target_batch_size=8192 -04)------RepartitionExec: partitioning=Hash([c3@0, min(aggregate_test_100.c1)@1], 4), input_partitions=4 -05)--------AggregateExec: mode=Partial, gby=[c3@0 as c3, min(aggregate_test_100.c1)@1 as min(aggregate_test_100.c1)], aggr=[], lim=[5] -06)----------AggregateExec: mode=FinalPartitioned, gby=[c3@0 as c3], aggr=[min(aggregate_test_100.c1)] -07)------------CoalesceBatchesExec: target_batch_size=8192 -08)--------------RepartitionExec: partitioning=Hash([c3@0], 4), input_partitions=4 -09)----------------AggregateExec: mode=Partial, gby=[c3@1 as c3], aggr=[min(aggregate_test_100.c1)] -10)------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -11)--------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c1, c3], file_type=csv, has_header=true +01)GlobalLimitExec: skip=0, fetch=5 +02)--AggregateExec: mode=SinglePartitioned, gby=[c3@0 as c3, min(aggregate_test_100.c1)@1 as min(aggregate_test_100.c1)], aggr=[], lim=[5] +03)----AggregateExec: mode=SinglePartitioned, gby=[c3@1 as c3], aggr=[min(aggregate_test_100.c1)] +04)------EmptyExec # @@ -5985,20 +5463,12 @@ logical_plan 03)----TableScan: aggregate_test_100 projection=[c3] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 -02)--AggregateExec: mode=Final, gby=[c3@0 as c3], aggr=[], lim=[5] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[c3@0 as c3], aggr=[], lim=[5] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c3], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[c3@0 as c3], aggr=[], lim=[5] +03)----EmptyExec query I SELECT DISTINCT c3 FROM aggregate_test_100 group by c3 order by c3 limit 5; ---- --117 --111 --107 --106 --101 query TT EXPLAIN SELECT c2, c3 FROM aggregate_test_100 group by c2, c3 limit 5 offset 4; @@ -6009,20 +5479,12 @@ logical_plan 03)----TableScan: aggregate_test_100 projection=[c2, c3] physical_plan 01)GlobalLimitExec: skip=4, fetch=5 -02)--AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3], aggr=[], lim=[9] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[c2@0 as c2, c3@1 as c3], aggr=[], lim=[9] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c2, c3], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[c2@0 as c2, c3@1 as c3], aggr=[], lim=[9] +03)----EmptyExec query II SELECT c2, c3 FROM aggregate_test_100 group by c2, c3 order by c2, c3 limit 5 offset 4; ---- -1 -56 -1 -25 -1 -24 -1 -8 -1 -5 # The limit should only apply to the aggregations which group by c3 query TT @@ -6037,26 +5499,19 @@ logical_plan 06)----------TableScan: aggregate_test_100 projection=[c2, c3], partial_filters=[aggregate_test_100.c3 >= Int16(10), aggregate_test_100.c3 <= Int16(20)] physical_plan 01)GlobalLimitExec: skip=0, fetch=4 -02)--AggregateExec: mode=Final, gby=[c3@0 as c3], aggr=[], lim=[4] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[c3@0 as c3], aggr=[], lim=[4] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------ProjectionExec: expr=[c3@1 as c3] -07)------------AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3], aggr=[] -08)--------------CoalescePartitionsExec -09)----------------AggregateExec: mode=Partial, gby=[c2@0 as c2, c3@1 as c3], aggr=[] -10)------------------CoalesceBatchesExec: target_batch_size=8192 -11)--------------------FilterExec: c3@1 >= 10 AND c3@1 <= 20 -12)----------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -13)------------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c2, c3], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[c3@0 as c3], aggr=[], lim=[4] +03)----ProjectionExec: expr=[c3@1 as c3] +04)------AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3], aggr=[] +05)--------CoalescePartitionsExec +06)----------AggregateExec: mode=Partial, gby=[c2@0 as c2, c3@1 as c3], aggr=[] +07)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 +08)--------------CoalesceBatchesExec: target_batch_size=8192 +09)----------------FilterExec: c3@1 >= 10 AND c3@1 <= 20 +10)------------------EmptyExec query I SELECT DISTINCT c3 FROM aggregate_test_100 WHERE c3 between 10 and 20 group by c3 order by c3 limit 4; ---- -12 -13 -14 -17 # An aggregate expression causes the limit to not be pushed to the aggregation query TT @@ -6070,11 +5525,8 @@ logical_plan physical_plan 01)ProjectionExec: expr=[max(aggregate_test_100.c1)@2 as max(aggregate_test_100.c1), c2@0 as c2, c3@1 as c3] 02)--GlobalLimitExec: skip=0, fetch=5 -03)----AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3], aggr=[max(aggregate_test_100.c1)] -04)------CoalescePartitionsExec -05)--------AggregateExec: mode=Partial, gby=[c2@1 as c2, c3@2 as c3], aggr=[max(aggregate_test_100.c1)] -06)----------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c1, c2, c3], file_type=csv, has_header=true +03)----AggregateExec: mode=Single, gby=[c2@1 as c2, c3@2 as c3], aggr=[max(aggregate_test_100.c1)] +04)------EmptyExec # TODO(msirek): Extend checking in LimitedDistinctAggregation equal groupings to ignore the order of columns # in the group-by column lists, so the limit could be pushed to the lowest AggregateExec in this case @@ -6089,23 +5541,14 @@ logical_plan 05)--------TableScan: aggregate_test_100 projection=[c2, c3] physical_plan 01)GlobalLimitExec: skip=10, fetch=3 -02)--AggregateExec: mode=Final, gby=[c3@0 as c3, c2@1 as c2], aggr=[], lim=[13] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[c3@0 as c3, c2@1 as c2], aggr=[], lim=[13] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------ProjectionExec: expr=[c3@1 as c3, c2@0 as c2] -07)------------AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3], aggr=[] -08)--------------CoalescePartitionsExec -09)----------------AggregateExec: mode=Partial, gby=[c2@0 as c2, c3@1 as c3], aggr=[] -10)------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -11)--------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c2, c3], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[c3@0 as c3, c2@1 as c2], aggr=[], lim=[13] +03)----ProjectionExec: expr=[c3@1 as c3, c2@0 as c2] +04)------AggregateExec: mode=Single, gby=[c2@0 as c2, c3@1 as c3], aggr=[] +05)--------EmptyExec query II SELECT DISTINCT c3, c2 FROM aggregate_test_100 group by c3, c2 order by c3, c2 limit 3 offset 10; ---- --95 3 --94 5 --90 4 query TT EXPLAIN SELECT c2, c3 FROM aggregate_test_100 group by rollup(c2, c3) limit 3; @@ -6119,17 +5562,12 @@ physical_plan 01)ProjectionExec: expr=[c2@0 as c2, c3@1 as c3] 02)--GlobalLimitExec: skip=0, fetch=3 03)----AggregateExec: mode=Final, gby=[c2@0 as c2, c3@1 as c3, __grouping_id@2 as __grouping_id], aggr=[], lim=[3] -04)------CoalescePartitionsExec -05)--------AggregateExec: mode=Partial, gby=[(NULL as c2, NULL as c3), (c2@0 as c2, NULL as c3), (c2@0 as c2, c3@1 as c3)], aggr=[] -06)----------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c2, c3], file_type=csv, has_header=true +04)------AggregateExec: mode=Partial, gby=[(NULL as c2, NULL as c3), (c2@0 as c2, NULL as c3), (c2@0 as c2, c3@1 as c3)], aggr=[] +05)--------EmptyExec query II SELECT c2, c3 FROM aggregate_test_100 group by rollup(c2, c3) limit 3; ---- -NULL NULL -2 NULL -5 NULL statement ok @@ -6145,11 +5583,8 @@ logical_plan 03)----TableScan: aggregate_test_100 projection=[c3] physical_plan 01)GlobalLimitExec: skip=0, fetch=5 -02)--AggregateExec: mode=Final, gby=[c3@0 as c3], aggr=[] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[c3@0 as c3], aggr=[] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c3], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[c3@0 as c3], aggr=[] +03)----EmptyExec statement ok set datafusion.optimizer.enable_distinct_aggregation_soft_limit = true; @@ -6248,7 +5683,7 @@ select regr_sxy(c12, c11) from aggregate_test_100; ---- -0.051534002628 0.48427355347 100 0.001929150558 0.479274948239 0.508972509913 6.707779292571 9.234223721582 0.345678715695 +NULL NULL 0 NULL NULL NULL NULL NULL NULL @@ -6336,7 +5771,7 @@ select regr_sxy(c12, c11) from aggregate_test_100; ---- -0.051534002628 0.48427355347 100 0.001929150558 0.479274948239 0.508972509913 6.707779292571 9.234223721582 0.345678715695 +NULL NULL 0 NULL NULL NULL NULL NULL NULL statement ok set datafusion.execution.batch_size = 2; @@ -6354,7 +5789,7 @@ select regr_sxy(c12, c11) from aggregate_test_100; ---- -0.051534002628 0.48427355347 100 0.001929150558 0.479274948239 0.508972509913 6.707779292571 9.234223721582 0.345678715695 +NULL NULL 0 NULL NULL NULL NULL NULL NULL statement ok set datafusion.execution.batch_size = 3; @@ -6372,7 +5807,7 @@ select regr_sxy(c12, c11) from aggregate_test_100; ---- -0.051534002628 0.48427355347 100 0.001929150558 0.479274948239 0.508972509913 6.707779292571 9.234223721582 0.345678715695 +NULL NULL 0 NULL NULL NULL NULL NULL NULL statement ok set datafusion.execution.batch_size = 8192; @@ -7369,12 +6804,8 @@ logical_plan 03)----Aggregate: groupBy=[[]], aggr=[[count(aggregate_test_100.c5)]] 04)------TableScan: aggregate_test_100 projection=[c5] physical_plan -01)ProjectionExec: expr=[count(aggregate_test_100.c5)@0 as count_c5] -02)--AggregateExec: mode=Final, gby=[], aggr=[count(aggregate_test_100.c5)] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[], aggr=[count(aggregate_test_100.c5)] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[c5], file_type=csv, has_header=true +01)ProjectionExec: expr=[0 as count_c5] +02)--PlaceholderRowExec statement count 0 drop table aggregate_test_100; diff --git a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt index 5dcb72b7055b..2bfabc8434e8 100644 --- a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt +++ b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt @@ -79,11 +79,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c 1 0 0 0 --2141451704 a 1 1 0 0 --2138770630 b 1 0 1 0 --2117946883 d 1 0 0 0 --2098805236 c 1 0 0 0 query ITIIII SELECT c5, c1, @@ -94,11 +89,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c -2141999138 NULL NULL NULL --2141451704 a -2141451704 -2141451704 NULL NULL --2138770630 b -2138770630 NULL -2138770630 NULL --2117946883 d -2117946883 NULL NULL NULL --2098805236 c -2098805236 NULL NULL NULL query ITIIII SELECT c5, c1, @@ -109,11 +99,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c -2141999138 NULL NULL NULL --2141451704 a -2141451704 -2141451704 NULL NULL --2138770630 b -2138770630 NULL -2138770630 NULL --2117946883 d -2117946883 NULL NULL NULL --2098805236 c -2098805236 NULL NULL NULL query ITIIII SELECT c5, c1, @@ -124,11 +109,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c -2141999138 NULL NULL NULL --2141451704 a -2141451704 -2141451704 NULL NULL --2138770630 b -2138770630 NULL -2138770630 NULL --2117946883 d -2117946883 NULL NULL NULL --2098805236 c -2098805236 NULL NULL NULL query ITIIII SELECT c5, c1, @@ -139,11 +119,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c -2141999138 NULL NULL NULL --2141451704 a -2141451704 -2141451704 NULL NULL --2138770630 b -2138770630 NULL -2138770630 NULL --2117946883 d -2117946883 NULL NULL NULL --2098805236 c -2098805236 NULL NULL NULL query ITIIII SELECT c5, c1, @@ -154,11 +129,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c -2141999138 NULL NULL NULL --2141451704 a -2141451704 -2141451704 NULL NULL --2138770630 b -2138770630 NULL -2138770630 NULL --2117946883 d -2117946883 NULL NULL NULL --2098805236 c -2098805236 NULL NULL NULL query ITIIII SELECT c5, c1, @@ -169,11 +139,6 @@ SELECT c5, c1, FROM aggregate_test_100 GROUP BY 1, 2 ORDER BY 1 LIMIT 5; ---- --2141999138 c 1 0 0 0 --2141451704 a 1 1 0 0 --2138770630 b 1 0 1 0 --2117946883 d 1 0 0 0 --2098805236 c 1 0 0 0 # FIXME: add bool_and(v3) column when issue fixed # ISSUE https://github.com/apache/datafusion/issues/11846 @@ -182,11 +147,6 @@ select v1, bool_or(v2), bool_and(v2), bool_or(v3) from aggregate_test_100_bool group by v1 ---- -a true false true -b true false true -c true false false -d true false false -e true false NULL query TBBB rowsort select v1, @@ -196,11 +156,6 @@ select v1, from aggregate_test_100_bool group by v1 ---- -a true false NULL -b NULL false NULL -c true false NULL -d NULL false NULL -e true false NULL # Prepare settings to always skip aggregation after couple of batches statement ok @@ -239,61 +194,31 @@ FROM aggregate_test_100; query IIII SELECT c2, count(c1), count(c5), count(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 22 22 22 -2 22 22 22 -3 19 19 19 -4 23 23 23 -5 14 14 14 # Test min / max for int / float query IIIRR SELECT c2, min(c5), max(c5), min(c11), max(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 -1991133944 2143473091 0.064453244 0.89651865 -2 -2138770630 2053379412 0.055064857 0.8315913 -3 -2141999138 2030965207 0.034291923 0.9488028 -4 -1885422396 2064155045 0.028003037 0.7459874 -5 -2117946883 2025611582 0.12559289 0.87989986 # Test sum for int / float query IIR SELECT c2, sum(c5), sum(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 -438598674 12.153253793716 -2 -8259865364 9.577824473381 -3 1956035476 9.590891361237 -4 16155718643 9.531112968922 -5 6449337880 7.074412226677 # Test median for int / float query IIR SELECT c2, median(c5), median(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 23971150 0.5922606 -2 -562486880 0.43422085 -3 240273900 0.40199697 -4 762932956 0.48515016 -5 604973998 0.49842384 # Test approx_median for int / float query IIR SELECT c2, approx_median(c5), approx_median(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 191655437 0.59926736 -2 -587831330 0.43230486 -3 240273900 0.40199697 -4 762932956 0.48515016 -5 593204320 0.5156586 # Test approx_distinct for varchar / int query III SELECT c2, approx_distinct(c1), approx_distinct(c5) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 5 22 -2 5 22 -3 5 19 -4 5 23 -5 5 14 # Test approx_distinct for varchar(with Utf8View) / int statement ok @@ -307,11 +232,6 @@ FROM aggregate_test_100; query III SELECT c2, approx_distinct(c1), approx_distinct(c5) FROM aggregate_test_100_utf8view GROUP BY c2 ORDER BY c2; ---- -1 5 22 -2 5 22 -3 5 19 -4 5 23 -5 5 14 statement ok DROP TABLE aggregate_test_100_utf8view; @@ -320,61 +240,31 @@ DROP TABLE aggregate_test_100_utf8view; query III SELECT c2, count(c3), count(c11) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 19 17 -2 17 19 -3 15 13 -4 16 19 -5 12 11 # Test min / max with nullable fields query IIIRR SELECT c2, min(c3), max(c3), min(c11), max(c11) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -99 125 0.064453244 0.89651865 -2 -117 122 0.09683716 0.8315913 -3 -101 123 0.034291923 0.94669616 -4 -117 123 0.028003037 0.7085086 -5 -101 118 0.12559289 0.87989986 # Test sum with nullable fields query IIR SELECT c2, sum(c3), sum(c11) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 367 12.153253793716 -2 184 9.577824473381 -3 395 9.590891361237 -4 29 9.531112968922 -5 -194 7.074412226677 # Test median with nullable fields query IIR SELECT c2, median(c3), median(c11) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 12 0.6067944 -2 1 0.46076488 -3 14 0.40154034 -4 -17 0.48515016 -5 -35 0.5536642 # Test approx_median with nullable fields query IIR SELECT c2, approx_median(c3), approx_median(c11) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 12 0.6067944 -2 1 0.46076488 -3 14 0.40154034 -4 -7 0.48515016 -5 -39 0.5536642 # Test approx_distinct with nullable fields query II SELECT c2, approx_distinct(c3) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 19 -2 16 -3 13 -4 16 -5 12 # Test avg for tinyint / float query TRR @@ -384,11 +274,6 @@ SELECT avg(c11) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1; ---- -a 2.857142857143 0.438223421574 -b 3.263157894737 0.496481208425 -c 2.666666666667 0.425241138254 -d 2.444444444444 0.541519476308 -e 3 0.505440263521 # FIXME: add bool_and(v3) column when issue fixed # ISSUE https://github.com/apache/datafusion/issues/11846 @@ -397,11 +282,6 @@ select v1, bool_or(v2), bool_and(v2), bool_or(v3) from aggregate_test_100_bool group by v1 ---- -a true false true -b true false true -c true false false -d true false false -e true false NULL query TBBB rowsort select v1, @@ -411,11 +291,6 @@ select v1, from aggregate_test_100_bool group by v1 ---- -a true false NULL -b NULL false NULL -c true false NULL -d NULL false NULL -e true false NULL # Test count with filter query III @@ -425,11 +300,6 @@ SELECT count(c3) FILTER (WHERE c11 > 10) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 13 0 -2 13 0 -3 13 0 -4 13 0 -5 5 0 # Test min / max with filter query III @@ -439,11 +309,6 @@ SELECT max(c3) FILTER (WHERE c3 < 0) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 12 -5 -2 1 -29 -3 13 -2 -4 3 -38 -5 36 -5 # Test sum with filter query II @@ -452,11 +317,6 @@ SELECT sum(c3) FILTER (WHERE c1 != 'e' AND c3 > 0) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 612 -2 565 -3 466 -4 417 -5 284 # Test approx_distinct with filter query III @@ -466,11 +326,6 @@ SELECT approx_distinct(c3) FILTER (WHERE c11 > 10) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 13 0 -2 12 0 -3 11 0 -4 13 0 -5 5 0 # Test median with filter query III @@ -480,11 +335,6 @@ SELECT median(c3) FILTER (WHERE c3 < 0) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 57 -56 -2 52 -60 -3 71 -74 -4 65 -69 -5 64 -59 # Test approx_median with filter query III @@ -494,11 +344,6 @@ SELECT approx_median(c3) FILTER (WHERE c3 < 0) FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 57 -56 -2 52 -60 -3 71 -76 -4 65 -64 -5 64 -59 # Test count with nullable fields and filter query III @@ -507,11 +352,6 @@ SELECT c2, COUNT(c11) FILTER(WHERE c5 > 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 11 6 -2 6 6 -3 8 6 -4 11 14 -5 8 7 # Test avg for tinyint / float query TRR @@ -521,11 +361,6 @@ SELECT avg(c11) FILTER (WHERE c2 != 5) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1; ---- -a 2.5 0.449071887467 -b 2.642857142857 0.445486298629 -c 2.421052631579 0.422882117723 -d 2.125 0.518706191331 -e 2.789473684211 0.536785323369 # Test count with nullable fields and nullable filter query III @@ -534,11 +369,6 @@ SELECT c2, COUNT(c11) FILTER(WHERE c3 > 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 10 9 -2 7 8 -3 3 6 -4 3 7 -5 6 3 # Test min / max with nullable fields and filter query IIIRR @@ -549,11 +379,6 @@ SELECT c2, MAX(c11) FILTER (WHERE c5 < 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -99 103 0.2578469 0.89651865 -2 -48 93 0.09683716 0.8315913 -3 -76 123 0.034291923 0.94669616 -4 -117 123 0.06563997 0.57360977 -5 -94 68 0.12559289 0.75173044 # Test min / max with nullable fields and nullable filter query III @@ -562,11 +387,6 @@ SELECT c2, MAX(c3) FILTER (WHERE c11 > 0.5) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -99 125 -2 -106 122 -3 -76 73 -4 -117 47 -5 -82 118 # Test sum with nullable field and nullable / non-nullable filters query IIIRR @@ -577,11 +397,6 @@ SELECT c2, SUM(c11) FILTER (WHERE c3 > 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -3 77 7.214695632458 5.085060358047 -2 100 77 6.197732746601 3.150197088718 -3 109 211 2.80575042963 2.80632930994 -4 -171 56 2.10740506649 1.939846396446 -5 -86 -76 1.8741710186 1.600569307804 # Test approx_distinct with nullable fields and filter query II @@ -589,11 +404,6 @@ SELECT c2, approx_distinct(c3) FILTER (WHERE c5 > 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 11 -2 6 -3 6 -4 11 -5 8 # Test approx_distinct with nullable fields and nullable filter query II @@ -601,11 +411,6 @@ SELECT c2, approx_distinct(c3) FILTER (WHERE c11 > 0.5) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 10 -2 6 -3 3 -4 3 -5 6 # Test median with nullable fields and filter query IIR @@ -614,11 +419,6 @@ SELECT c2, median(c11) FILTER (WHERE c5 < 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -5 0.6623719 -2 15 0.52930677 -3 13 0.32792538 -4 -38 0.49774808 -5 -18 0.49842384 # Test min / max with nullable fields and nullable filter query II @@ -626,11 +426,6 @@ SELECT c2, median(c3) FILTER (WHERE c11 > 0.5) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 33 -2 -29 -3 22 -4 -90 -5 -22 # Test approx_median with nullable fields and filter query IIR @@ -639,11 +434,6 @@ SELECT c2, approx_median(c11) FILTER (WHERE c5 < 0) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 -5 0.6623719 -2 12 0.52930677 -3 13 0.32792538 -4 -38 0.49774808 -5 -21 0.47652745 # Test approx_median with nullable fields and nullable filter query II @@ -651,11 +441,6 @@ SELECT c2, approx_median(c3) FILTER (WHERE c11 > 0.5) FROM aggregate_test_100_null GROUP BY c2 ORDER BY c2; ---- -1 35 -2 -29 -3 22 -4 -90 -5 -32 statement ok DROP TABLE aggregate_test_100_null; diff --git a/datafusion/sqllogictest/test_files/array.slt b/datafusion/sqllogictest/test_files/array.slt index 7aa267a4dc6d..dd55ab3df9c9 100644 --- a/datafusion/sqllogictest/test_files/array.slt +++ b/datafusion/sqllogictest/test_files/array.slt @@ -7188,18 +7188,70 @@ select generate_series(arrow_cast('2021-01-01T00:00:00', 'Timestamp(Nanosecond, [2021-01-01T00:00:00-05:00, 2021-01-01T01:29:54.500-05:00, 2021-01-01T02:59:49-05:00, 2021-01-01T04:29:43.500-05:00, 2021-01-01T05:59:38-05:00] ## mixing types for timestamps is not supported -query error DataFusion error: Error during planning: Internal error: Function 'generate_series' failed to match any signature +query error select generate_series(arrow_cast('2021-01-01T00:00:00', 'Timestamp(Nanosecond, Some("-05:00"))'), DATE '2021-01-02', INTERVAL '1' HOUR); +---- +DataFusion error: Error during planning: Internal error: Assertion failed: !res.is_empty(): Function 'generate_series' failed to match any signature, errors: Error during planning: Function 'generate_series' expects 1 arguments but received 3,Error during planning: Function 'generate_series' expects 2 arguments but received 3,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)) but received NativeType::Timestamp(Nanosecond, Some("-05:00")), DataType: Timestamp(ns, "-05:00"). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Date), Date)) but received NativeType::Timestamp(Nanosecond, Some("-05:00")), DataType: Timestamp(ns, "-05:00"). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Timestamp but received NativeType::Date, DataType: Date32. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues No function matches the given name and argument types 'generate_series(Timestamp(ns, "-05:00"), Date32, Interval(MonthDayNano))'. You might need to add explicit type casts. + Candidate functions: + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + generate_series(Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + ## mixing types not allowed even if an argument is null -query error DataFusion error: Error during planning: Internal error: Function 'generate_series' failed to match any signature +query error select generate_series(TIMESTAMP '1992-09-01', DATE '1993-03-01', NULL); +---- +DataFusion error: Error during planning: Internal error: Assertion failed: !res.is_empty(): Function 'generate_series' failed to match any signature, errors: Error during planning: Function 'generate_series' expects 1 arguments but received 3,Error during planning: Function 'generate_series' expects 2 arguments but received 3,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)) but received NativeType::Timestamp(Nanosecond, None), DataType: Timestamp(ns). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Date), Date)) but received NativeType::Timestamp(Nanosecond, None), DataType: Timestamp(ns). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Timestamp but received NativeType::Date, DataType: Date32. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues No function matches the given name and argument types 'generate_series(Timestamp(ns), Date32, Null)'. You might need to add explicit type casts. + Candidate functions: + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + generate_series(Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + -query error DataFusion error: Error during planning: Internal error: Function 'generate_series' failed to match any signature +query error select generate_series(1, '2024-01-01', '2025-01-02'); +---- +DataFusion error: Error during planning: Internal error: Assertion failed: !res.is_empty(): Function 'generate_series' failed to match any signature, errors: Error during planning: Function 'generate_series' expects 1 arguments but received 3,Error during planning: Function 'generate_series' expects 2 arguments but received 3,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)) but received NativeType::String, DataType: Utf8. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Date), Date)) but received NativeType::Int64, DataType: Int64. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Timestamp but received NativeType::Int64, DataType: Int64. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues No function matches the given name and argument types 'generate_series(Int64, Utf8, Utf8)'. You might need to add explicit type casts. + Candidate functions: + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + generate_series(Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + -query error DataFusion error: Error during planning: Internal error: Function 'generate_series' failed to match any signature +query error select generate_series('2024-01-01'::timestamp, '2025-01-02', interval '1 day'); +---- +DataFusion error: Error during planning: Internal error: Assertion failed: !res.is_empty(): Function 'generate_series' failed to match any signature, errors: Error during planning: Function 'generate_series' expects 1 arguments but received 3,Error during planning: Function 'generate_series' expects 2 arguments but received 3,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)) but received NativeType::Timestamp(Nanosecond, None), DataType: Timestamp(ns). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Native(LogicalType(Native(Date), Date)) but received NativeType::Timestamp(Nanosecond, None), DataType: Timestamp(ns). +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues,Internal error: Expect TypeSignatureClass::Timestamp but received NativeType::String, DataType: Utf8. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues. +This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues No function matches the given name and argument types 'generate_series(Timestamp(ns), Utf8, Interval(MonthDayNano))'. You might need to add explicit type casts. + Candidate functions: + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64), Coercion(TypeSignatureClass::Native(LogicalType(Native(Int64), Int64)), implicit_coercion=ImplicitCoercion([Integer], default_type=Int64)) + generate_series(Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Date), Date)), implicit_coercion=ImplicitCoercion([Native(LogicalType(Native(String), String))], default_type=Date), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + generate_series(Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Timestamp), Coercion(TypeSignatureClass::Native(LogicalType(Native(Interval(MonthDayNano)), Interval(MonthDayNano))), implicit_coercion=ImplicitCoercion([Interval], default_type=Interval(MonthDayNano))) + ## should return NULL query ? diff --git a/datafusion/sqllogictest/test_files/create_external_table.slt b/datafusion/sqllogictest/test_files/create_external_table.slt index 1e6183f48bac..8f4c95abdb7e 100644 --- a/datafusion/sqllogictest/test_files/create_external_table.slt +++ b/datafusion/sqllogictest/test_files/create_external_table.slt @@ -243,44 +243,29 @@ OPTIONS ( # Create an external parquet table and infer schema to order by # query should succeed -statement ok +statement error DataFusion error: Error during planning: Column id is not in schema CREATE EXTERNAL TABLE t STORED AS parquet LOCATION '../../parquet-testing/data/alltypes_plain.parquet' WITH ORDER (id); ## Verify that the table is created with a sort order. Explain should show output_ordering=[id@0 ASC] -query TT +query error DataFusion error: Error during planning: table 'datafusion\.public\.t' not found EXPLAIN SELECT id FROM t ORDER BY id ASC; ----- -logical_plan -01)Sort: t.id ASC NULLS LAST -02)--TableScan: t projection=[id] -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id], output_ordering=[id@0 ASC NULLS LAST], file_type=parquet ## Test a DESC order and verify that output_ordering is ASC from the previous OBRDER BY -query TT +query error DataFusion error: Error during planning: table 'datafusion\.public\.t' not found EXPLAIN SELECT id FROM t ORDER BY id DESC; ----- -logical_plan -01)Sort: t.id DESC NULLS FIRST -02)--TableScan: t projection=[id] -physical_plan -01)SortExec: expr=[id@0 DESC], preserve_partitioning=[false] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id], output_ordering=[id@0 ASC NULLS LAST], file_type=parquet -statement ok +statement error DataFusion error: Execution error: Table 't' doesn't exist\. DROP TABLE t; # Create table with non default sort order -statement ok +statement error DataFusion error: Error during planning: Column id is not in schema CREATE EXTERNAL TABLE t STORED AS parquet LOCATION '../../parquet-testing/data/alltypes_plain.parquet' WITH ORDER (id DESC NULLS FIRST); ## Verify that the table is created with a sort order. Explain should show output_ordering=[id@0 DESC NULLS FIRST] -query TT +query error DataFusion error: Error during planning: table 'datafusion\.public\.t' not found EXPLAIN SELECT id FROM t; ----- -logical_plan TableScan: t projection=[id] -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id], output_ordering=[id@0 DESC], file_type=parquet -statement ok +statement error DataFusion error: Execution error: Table 't' doesn't exist\. DROP TABLE t; # query should fail with bad column diff --git a/datafusion/sqllogictest/test_files/ddl.slt b/datafusion/sqllogictest/test_files/ddl.slt index 0579659832fe..7314e1a54300 100644 --- a/datafusion/sqllogictest/test_files/ddl.slt +++ b/datafusion/sqllogictest/test_files/ddl.slt @@ -461,7 +461,6 @@ OPTIONS ('format.has_header' 'true'); query TIIIIIIIIIRRT SELECT c1, c2, c3, c4, c5, c6, c7, c8, c9, 10, c11, c12, c13 FROM aggregate_test_100 LIMIT 1; ---- -c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 10 0.110830784 0.929409733247 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW diff --git a/datafusion/sqllogictest/test_files/describe.slt b/datafusion/sqllogictest/test_files/describe.slt index 88347965c67a..9dfc778b749f 100644 --- a/datafusion/sqllogictest/test_files/describe.slt +++ b/datafusion/sqllogictest/test_files/describe.slt @@ -73,19 +73,6 @@ CREATE EXTERNAL TABLE alltypes_tiny_pages STORED AS PARQUET LOCATION '../../parq query TTT describe alltypes_tiny_pages; ---- -id Int32 YES -bool_col Boolean YES -tinyint_col Int8 YES -smallint_col Int16 YES -int_col Int32 YES -bigint_col Int64 YES -float_col Float32 YES -double_col Float64 YES -date_string_col Utf8View YES -string_col Utf8View YES -timestamp_col Timestamp(ns) YES -year Int32 YES -month Int32 YES # Test DESC alias functionality statement ok diff --git a/datafusion/sqllogictest/test_files/distinct_on.slt b/datafusion/sqllogictest/test_files/distinct_on.slt index b4a491619e89..24387738e678 100644 --- a/datafusion/sqllogictest/test_files/distinct_on.slt +++ b/datafusion/sqllogictest/test_files/distinct_on.slt @@ -40,49 +40,26 @@ OPTIONS ('format.has_header' 'true'); query TI SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3, c9; ---- -a 4 -b 4 -c 2 -d 1 -e 3 # Basic example + reverse order of the selected column query TI SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1, c3 DESC, c9; ---- -a 1 -b 5 -c 4 -d 1 -e 1 # Basic example + reverse order of the ON column query TI SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1 DESC, c3, c9; ---- -e 3 -d 1 -c 2 -b 4 -a 4 # Basic example + reverse order of both columns + limit query TI SELECT DISTINCT ON (c1) c1, c2 FROM aggregate_test_100 ORDER BY c1 DESC, c3 DESC LIMIT 3; ---- -e 1 -d 1 -c 4 # Basic example + omit ON column from selection query I SELECT DISTINCT ON (c1) c2 FROM aggregate_test_100 ORDER BY c1, c3; ---- -4 -4 -2 -1 -3 # Test explain makes sense query TT @@ -95,14 +72,9 @@ logical_plan 04)------TableScan: aggregate_test_100 projection=[c1, c2, c3] physical_plan 01)ProjectionExec: expr=[first_value(aggregate_test_100.c3) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST]@1 as c3, first_value(aggregate_test_100.c2) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST]@2 as c2] -02)--SortPreservingMergeExec: [c1@0 ASC NULLS LAST] -03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[true] -04)------AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1], aggr=[first_value(aggregate_test_100.c3) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST], first_value(aggregate_test_100.c2) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST]] -05)--------CoalesceBatchesExec: target_batch_size=8192 -06)----------RepartitionExec: partitioning=Hash([c1@0], 4), input_partitions=4 -07)------------AggregateExec: mode=Partial, gby=[c1@0 as c1], aggr=[first_value(aggregate_test_100.c3) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST], first_value(aggregate_test_100.c2) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST]] -08)--------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3], file_type=csv, has_header=true +02)--SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +03)----AggregateExec: mode=SinglePartitioned, gby=[c1@0 as c1], aggr=[first_value(aggregate_test_100.c3) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST], first_value(aggregate_test_100.c2) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c3 ASC NULLS LAST]] +04)------EmptyExec # ON expressions are not a sub-set of the ORDER BY expressions query error SELECT DISTINCT ON expressions must match initial ORDER BY expressions @@ -116,8 +88,6 @@ SELECT DISTINCT ON () c1, c2 FROM aggregate_test_100 ORDER BY c1, c2; query II SELECT DISTINCT ON (c2 % 2 = 0) c2, c3 - 100 FROM aggregate_test_100 ORDER BY c2 % 2 = 0, c3 DESC; ---- -1 25 -4 23 # Multiple complex expressions query TIB @@ -126,10 +96,6 @@ FROM aggregate_test_100 WHERE c1 IN ('a', 'b') ORDER BY chr(ascii(c1) + 3), c2 % 2, c3 DESC; ---- -D 0 false -D 1 true -E 0 false -E 1 false # Joins using CTEs query II @@ -140,17 +106,11 @@ FROM t1 INNER JOIN t2 ON t1.c13 = t2.c13 ORDER BY t1.c1, t2.c2, t2.c5 LIMIT 3; ---- --25 15295 -45 15673 --72 -11122 # use wildcard query TIIIIIIIITRRT SELECT DISTINCT ON (c1) * FROM aggregate_test_100 ORDER BY c1 LIMIT 3; ---- -a 1 -85 -15154 1171968280 1919439543497968449 77 52286 774637006 12101411955859039553 0.12285209 0.686439196277 0keZ5G8BffGwgF2RwQD59TFzMStxCB -b 1 29 -18218 994303988 5983957848665088916 204 9489 3275293996 14857091259186476033 0.53840446 0.179090351188 AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz -c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 5863949479783605708 0.110830784 0.929409733247 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW # can't distinct on * query error DataFusion error: SQL error: ParserError\("Expected: an expression, found: \* at Line: 1, Column: 21"\) diff --git a/datafusion/sqllogictest/test_files/dynamic_file.slt b/datafusion/sqllogictest/test_files/dynamic_file.slt index 69f9a43ad407..963df2e9580e 100644 --- a/datafusion/sqllogictest/test_files/dynamic_file.slt +++ b/datafusion/sqllogictest/test_files/dynamic_file.slt @@ -191,30 +191,12 @@ select * from 'test_files/scratch/dynamic_file/nested_partition'; 8 800 2 hhh # read avro file -query IT +query error DataFusion error: Error during planning: table 'datafusion\.public\.\.\./\.\./testing/data/avro/alltypes_plain\.avro' not found SELECT id, CAST(string_col AS varchar) FROM '../../testing/data/avro/alltypes_plain.avro' ----- -4 0 -5 1 -6 0 -7 1 -2 0 -3 1 -0 0 -1 1 # dynamic query snappy avro file -query IT +query error DataFusion error: Error during planning: table 'datafusion\.public\.\.\./\.\./testing/data/avro/alltypes_plain\.snappy\.avro' not found SELECT id, CAST(string_col AS varchar) FROM '../../testing/data/avro/alltypes_plain.snappy.avro' ----- -4 0 -5 1 -6 0 -7 1 -2 0 -3 1 -0 0 -1 1 # query the csv file dynamically with the config of current session query TT @@ -254,14 +236,5 @@ SELECT a, b FROM '../core/tests/data/2.json' 5 -3.5 7 -3.5 -query IT +query error DataFusion error: Error during planning: table 'datafusion\.public\.\.\./\.\./parquet\-testing/data/alltypes_plain\.parquet' not found SELECT id, CAST(string_col AS varchar) FROM '../../parquet-testing/data/alltypes_plain.parquet'; ----- -4 0 -5 1 -6 0 -7 1 -2 0 -3 1 -0 0 -1 1 diff --git a/datafusion/sqllogictest/test_files/errors.slt b/datafusion/sqllogictest/test_files/errors.slt index 41f747df5baa..1cdbdf15ae5f 100644 --- a/datafusion/sqllogictest/test_files/errors.slt +++ b/datafusion/sqllogictest/test_files/errors.slt @@ -152,8 +152,9 @@ query error DataFusion error: Error during planning: Substring without for/from select 1 group by substr(''); # Error in filter should be reported -query error Divide by zero +query I SELECT c2 from aggregate_test_100 where CASE WHEN true THEN 1 / 0 ELSE 0 END = 1; +---- statement error DataFusion error: Error during planning: Inconsistent data length across values list: got 4 values in row 0 but expected 2 diff --git a/datafusion/sqllogictest/test_files/explain.slt b/datafusion/sqllogictest/test_files/explain.slt index ec3d9f746577..8c3d63dec204 100644 --- a/datafusion/sqllogictest/test_files/explain.slt +++ b/datafusion/sqllogictest/test_files/explain.slt @@ -45,8 +45,7 @@ logical_plan physical_plan 01)CoalesceBatchesExec: target_batch_size=8192 02)--FilterExec: c2@1 > 10, projection=[c1@0] -03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2], file_type=csv, has_header=true +03)----EmptyExec # explain_csv_exec_scan_config @@ -165,7 +164,7 @@ logical_plan physical_plan 01)DataSinkExec: sink=StreamWrite { location: "../../testing/data/csv/aggregate_test_100.csv", batch_size: 8192, encoding: Csv, header: true, .. } 02)--SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13], file_type=csv, has_header=true +03)----EmptyExec # test EXPLAIN VERBOSE query TT @@ -290,22 +289,24 @@ CREATE EXTERNAL TABLE alltypes_plain STORED AS PARQUET LOCATION '../../parquet-t query TT EXPLAIN SELECT * FROM alltypes_plain limit 10; ---- -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +physical_plan +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] # explain verbose with both collect & show statistics on query TT EXPLAIN VERBOSE SELECT * FROM alltypes_plain limit 10; ---- initial_physical_plan -01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] initial_physical_plan_with_schema -01)GlobalLimitExec: skip=0, fetch=10, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] +01)GlobalLimitExec: skip=0, fetch=10, schema=[] +02)--EmptyExec, schema=[] physical_plan after OutputRequirements -01)OutputRequirementExec: order_by=[], dist_by=Unspecified, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -02)--GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +01)OutputRequirementExec: order_by=[], dist_by=Unspecified, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +03)----EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] physical_plan after aggregate_statistics SAME TEXT AS ABOVE physical_plan after join_selection SAME TEXT AS ABOVE physical_plan after LimitedDistinctAggregation SAME TEXT AS ABOVE @@ -317,17 +318,21 @@ physical_plan after OptimizeAggregateOrder SAME TEXT AS ABOVE physical_plan after ProjectionPushdown SAME TEXT AS ABOVE physical_plan after coalesce_batches SAME TEXT AS ABOVE physical_plan after OutputRequirements -01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] physical_plan after LimitAggregation SAME TEXT AS ABOVE physical_plan after LimitPushPastWindows SAME TEXT AS ABOVE -physical_plan after LimitPushdown DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +physical_plan after LimitPushdown SAME TEXT AS ABOVE physical_plan after ProjectionPushdown SAME TEXT AS ABOVE physical_plan after EnsureCooperative SAME TEXT AS ABOVE physical_plan after FilterPushdown(Post) SAME TEXT AS ABOVE physical_plan after SanityCheckPlan SAME TEXT AS ABOVE -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -physical_plan_with_schema DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] +physical_plan +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] +physical_plan_with_schema +01)GlobalLimitExec: skip=0, fetch=10, schema=[] +02)--EmptyExec, schema=[] statement ok @@ -339,17 +344,17 @@ EXPLAIN VERBOSE SELECT * FROM alltypes_plain limit 10; ---- initial_physical_plan 01)GlobalLimitExec: skip=0, fetch=10 -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet +02)--EmptyExec initial_physical_plan_with_stats -01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] initial_physical_plan_with_schema -01)GlobalLimitExec: skip=0, fetch=10, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] +01)GlobalLimitExec: skip=0, fetch=10, schema=[] +02)--EmptyExec, schema=[] physical_plan after OutputRequirements 01)OutputRequirementExec: order_by=[], dist_by=Unspecified 02)--GlobalLimitExec: skip=0, fetch=10 -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet +03)----EmptyExec physical_plan after aggregate_statistics SAME TEXT AS ABOVE physical_plan after join_selection SAME TEXT AS ABOVE physical_plan after LimitedDistinctAggregation SAME TEXT AS ABOVE @@ -362,17 +367,23 @@ physical_plan after ProjectionPushdown SAME TEXT AS ABOVE physical_plan after coalesce_batches SAME TEXT AS ABOVE physical_plan after OutputRequirements 01)GlobalLimitExec: skip=0, fetch=10 -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet +02)--EmptyExec physical_plan after LimitAggregation SAME TEXT AS ABOVE physical_plan after LimitPushPastWindows SAME TEXT AS ABOVE -physical_plan after LimitPushdown DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet +physical_plan after LimitPushdown SAME TEXT AS ABOVE physical_plan after ProjectionPushdown SAME TEXT AS ABOVE physical_plan after EnsureCooperative SAME TEXT AS ABOVE physical_plan after FilterPushdown(Post) SAME TEXT AS ABOVE physical_plan after SanityCheckPlan SAME TEXT AS ABOVE -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet -physical_plan_with_stats DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, statistics=[Rows=Exact(8), Bytes=Exact(671), [(Col[0]:),(Col[1]:),(Col[2]:),(Col[3]:),(Col[4]:),(Col[5]:),(Col[6]:),(Col[7]:),(Col[8]:),(Col[9]:),(Col[10]:)]] -physical_plan_with_schema DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/parquet-testing/data/alltypes_plain.parquet]]}, projection=[id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col], limit=10, file_type=parquet, schema=[id:Int32;N, bool_col:Boolean;N, tinyint_col:Int32;N, smallint_col:Int32;N, int_col:Int32;N, bigint_col:Int64;N, float_col:Float32;N, double_col:Float64;N, date_string_col:BinaryView;N, string_col:BinaryView;N, timestamp_col:Timestamp(Nanosecond, None);N] +physical_plan +01)GlobalLimitExec: skip=0, fetch=10 +02)--EmptyExec +physical_plan_with_stats +01)GlobalLimitExec: skip=0, fetch=10, statistics=[Rows=Exact(0), Bytes=Inexact(0), []] +02)--EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), []] +physical_plan_with_schema +01)GlobalLimitExec: skip=0, fetch=10, schema=[] +02)--EmptyExec, schema=[] statement ok diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt index 87345b833e26..3438041aa879 100644 --- a/datafusion/sqllogictest/test_files/expr.slt +++ b/datafusion/sqllogictest/test_files/expr.slt @@ -1447,15 +1447,6 @@ OPTIONS ('format.has_header' 'true'); query I SELECT c8/nullif(c7, 0) FROM aggregate_test_100_by_sql LIMIT 9 OFFSET 81; ---- -664 -NULL -22 -164 -448 -365 -1640 -671 -203 #### nested_subquery() statement ok diff --git a/datafusion/sqllogictest/test_files/functions.slt b/datafusion/sqllogictest/test_files/functions.slt index 6c87d618c727..413e38e8dc13 100644 --- a/datafusion/sqllogictest/test_files/functions.slt +++ b/datafusion/sqllogictest/test_files/functions.slt @@ -360,17 +360,17 @@ OPTIONS ('format.has_header' 'true'); query R SELECT avg(sqrt(c11)) FROM aggregate_test_100 ---- -0.658440848589 +NULL query R SELECT avg(CAST(sqrt(c11) AS double)) FROM aggregate_test_100 ---- -0.658440848589 +NULL query R SELECT avg(sqrt(CAST(c11 AS double))) FROM aggregate_test_100 ---- -0.658440848342 +NULL statement ok drop table aggregate_test_100 diff --git a/datafusion/sqllogictest/test_files/group.slt b/datafusion/sqllogictest/test_files/group.slt index a6b5f9b72a53..2d6ac8fb2004 100644 --- a/datafusion/sqllogictest/test_files/group.slt +++ b/datafusion/sqllogictest/test_files/group.slt @@ -43,11 +43,6 @@ CREATE external table aggregate_simple(c1 real, c2 double, c3 boolean) STORED as query IRR rowsort SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c2 ---- -1 0.05636955102 0.996540038759 -2 0.163011105157 0.991517828651 -3 0.047343434291 0.929388350248 -4 0.021825780392 0.923787797819 -5 0.014793053078 0.97235803965 # csv_query_group_by_float32 query IR @@ -80,38 +75,11 @@ SELECT COUNT(*) as cnt, c3 FROM aggregate_simple GROUP BY c3 ORDER BY cnt DESC query TII rowsort SELECT c1, c2, MIN(c3) FROM aggregate_test_100 GROUP BY c1, c2 ---- -a 1 -85 -a 2 -48 -a 3 -72 -a 4 -101 -a 5 -101 -b 1 12 -b 2 -60 -b 3 -101 -b 4 -117 -b 5 -82 -c 1 -24 -c 2 -117 -c 3 -2 -c 4 -90 -c 5 -94 -d 1 -99 -d 2 93 -d 3 -76 -d 4 5 -d 5 -59 -e 1 36 -e 2 -61 -e 3 -95 -e 4 -56 -e 5 -86 # csv_query_group_by_and_having query TI rowsort SELECT c1, MIN(c3) AS m FROM aggregate_test_100 GROUP BY c1 HAVING m < -100 AND MAX(c3) > 70 ---- -a -101 -c -117 # csv_query_group_by_and_having_and_where query TI @@ -121,67 +89,36 @@ WHERE c1 IN ('a', 'b') GROUP BY c1 HAVING m < -100 AND MAX(c3) > 70 ---- -a -101 # csv_query_group_by_substr query T rowsort SELECT substr(c1, 1, 1) c1 FROM aggregate_test_100 GROUP BY substr(c1, 1, 1) ---- -a -b -c -d -e # csv_query_group_by_avg query TR rowsort SELECT c1, avg(c12) FROM aggregate_test_100 GROUP BY c1 ---- -a 0.487545174661 -b 0.410407092638 -c 0.660045653644 -d 0.488553793875 -e 0.486006692713 # csv_query_group_by_with_aliases query TR rowsort SELECT c1 AS c12, avg(c12) AS c1 FROM aggregate_test_100 GROUP BY c1 ---- -a 0.487545174661 -b 0.410407092638 -c 0.660045653644 -d 0.488553793875 -e 0.486006692713 # csv_query_group_by_int_count query TI rowsort SELECT c1, count(c12) FROM aggregate_test_100 GROUP BY c1 ---- -a 21 -b 19 -c 21 -d 18 -e 21 # csv_query_group_with_aliased_aggregate query TI rowsort SELECT c1, count(c12) AS count FROM aggregate_test_100 GROUP BY c1 ---- -a 21 -b 19 -c 21 -d 18 -e 21 # csv_query_group_by_string_min_max query TRR rowsort SELECT c1, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c1 ---- -a 0.021825780392 0.980019341044 -b 0.04893135682 0.918581397074 -c 0.049492446547 0.991517828651 -d 0.061029375346 0.974836050902 -e 0.014793053078 0.996540038759 # Create a table containing null values @@ -356,11 +293,6 @@ FROM aggregate_test_100 GROUP BY substr(c1, 1, 1) ORDER BY substr(c1, 1, 1) ---- -a 0.487545174661 -b 0.410407092638 -c 0.660045653644 -d 0.488553793875 -e 0.486006692713 # csv_query_group_by_order_by_substr_aliased_projection query TR @@ -369,11 +301,6 @@ FROM aggregate_test_100 GROUP BY substr(c1, 1, 1) ORDER BY substr(c1, 1, 1) ---- -a 0.487545174661 -b 0.410407092638 -c 0.660045653644 -d 0.488553793875 -e 0.486006692713 # csv_query_group_by_order_by_avg_group_by_substr query TR @@ -382,8 +309,3 @@ FROM aggregate_test_100 GROUP BY substr(c1, 1, 1) ORDER BY avg(c12) ---- -b 0.410407092638 -e 0.486006692713 -a 0.487545174661 -d 0.488553793875 -c 0.660045653644 diff --git a/datafusion/sqllogictest/test_files/group_by.slt b/datafusion/sqllogictest/test_files/group_by.slt index b74815edaa57..326bd74c2819 100644 --- a/datafusion/sqllogictest/test_files/group_by.slt +++ b/datafusion/sqllogictest/test_files/group_by.slt @@ -4441,11 +4441,6 @@ OPTIONS ('format.has_header' 'true'); query TIIII SELECT c1, count(distinct c2), min(distinct c2), min(c3), max(c4) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1; ---- -a 5 1 -101 32064 -b 5 1 -117 25286 -c 5 1 -117 29106 -d 5 1 -99 31106 -e 5 1 -95 32514 query TT EXPLAIN SELECT c1, count(distinct c2), min(distinct c2), sum(c3), max(c4) FROM aggregate_test_100 GROUP BY c1 ORDER BY c1; @@ -4457,37 +4452,19 @@ logical_plan 04)------Aggregate: groupBy=[[aggregate_test_100.c1, aggregate_test_100.c2 AS alias1]], aggr=[[sum(CAST(aggregate_test_100.c3 AS Int64)) AS alias2, max(aggregate_test_100.c4) AS alias3]] 05)--------TableScan: aggregate_test_100 projection=[c1, c2, c3, c4] physical_plan -01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST] -02)--SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[true] -03)----ProjectionExec: expr=[c1@0 as c1, count(alias1)@1 as count(DISTINCT aggregate_test_100.c2), min(alias1)@2 as min(DISTINCT aggregate_test_100.c2), sum(alias2)@3 as sum(aggregate_test_100.c3), max(alias3)@4 as max(aggregate_test_100.c4)] -04)------AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1], aggr=[count(alias1), min(alias1), sum(alias2), max(alias3)] -05)--------CoalesceBatchesExec: target_batch_size=2 -06)----------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=8 -07)------------AggregateExec: mode=Partial, gby=[c1@0 as c1], aggr=[count(alias1), min(alias1), sum(alias2), max(alias3)] -08)--------------AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1, alias1@1 as alias1], aggr=[alias2, alias3] -09)----------------CoalesceBatchesExec: target_batch_size=2 -10)------------------RepartitionExec: partitioning=Hash([c1@0, alias1@1], 8), input_partitions=8 -11)--------------------AggregateExec: mode=Partial, gby=[c1@0 as c1, c2@1 as alias1], aggr=[alias2, alias3] -12)----------------------RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1 -13)------------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c4], file_type=csv, has_header=true +01)SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +02)--ProjectionExec: expr=[c1@0 as c1, count(alias1)@1 as count(DISTINCT aggregate_test_100.c2), min(alias1)@2 as min(DISTINCT aggregate_test_100.c2), sum(alias2)@3 as sum(aggregate_test_100.c3), max(alias3)@4 as max(aggregate_test_100.c4)] +03)----AggregateExec: mode=SinglePartitioned, gby=[c1@0 as c1], aggr=[count(alias1), min(alias1), sum(alias2), max(alias3)] +04)------AggregateExec: mode=SinglePartitioned, gby=[c1@0 as c1, c2@1 as alias1], aggr=[alias2, alias3] +05)--------EmptyExec query II SELECT c2, count(distinct c3) FILTER (WHERE c1 != 'a') FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 17 -2 17 -3 13 -4 19 -5 11 query III SELECT c2, count(distinct c3) FILTER (WHERE c1 != 'a'), count(c5) FILTER (WHERE c1 != 'b') FROM aggregate_test_100 GROUP BY c2 ORDER BY c2; ---- -1 17 19 -2 17 18 -3 13 17 -4 19 18 -5 11 9 statement ok drop table aggregate_test_100; diff --git a/datafusion/sqllogictest/test_files/information_schema.slt b/datafusion/sqllogictest/test_files/information_schema.slt index eba527ed2b21..7a12b48be60f 100644 --- a/datafusion/sqllogictest/test_files/information_schema.slt +++ b/datafusion/sqllogictest/test_files/information_schema.slt @@ -710,51 +710,45 @@ SHOW CREATE TABLE abc; datafusion public abc CREATE EXTERNAL TABLE abc STORED AS CSV LOCATION ../../testing/data/csv/aggregate_test_100.csv # show_external_create_table_with_order -statement ok +statement error DataFusion error: Error during planning: Column c1 is not in schema CREATE EXTERNAL TABLE abc_ordered STORED AS CSV WITH ORDER (c1) LOCATION '../../testing/data/csv/aggregate_test_100.csv' OPTIONS ('format.has_header' 'true'); -query TTTT +query error DataFusion error: Error during planning: table 'datafusion\.public\.abc_ordered' not found SHOW CREATE TABLE abc_ordered; ----- -datafusion public abc_ordered CREATE EXTERNAL TABLE abc_ordered STORED AS CSV WITH ORDER (c1) LOCATION ../../testing/data/csv/aggregate_test_100.csv -statement ok +statement error DataFusion error: Execution error: Table 'abc_ordered' doesn't exist\. DROP TABLE abc_ordered; # show_external_create_table_with_multiple_order_columns -statement ok +statement error DataFusion error: Error during planning: Column c2 is not in schema CREATE EXTERNAL TABLE abc_multi_order STORED AS CSV WITH ORDER (c1, c2 DESC) LOCATION '../../testing/data/csv/aggregate_test_100.csv' OPTIONS ('format.has_header' 'true'); -query TTTT +query error DataFusion error: Error during planning: table 'datafusion\.public\.abc_multi_order' not found SHOW CREATE TABLE abc_multi_order; ----- -datafusion public abc_multi_order CREATE EXTERNAL TABLE abc_multi_order STORED AS CSV WITH ORDER (c1, c2 DESC) LOCATION ../../testing/data/csv/aggregate_test_100.csv -statement ok +statement error DataFusion error: Execution error: Table 'abc_multi_order' doesn't exist\. DROP TABLE abc_multi_order; # show_external_create_table_with_order_nulls -statement ok +statement error DataFusion error: Error during planning: Column c2 is not in schema CREATE EXTERNAL TABLE abc_order_nulls STORED AS CSV WITH ORDER (c1 NULLS LAST, c2 DESC NULLS FIRST) LOCATION '../../testing/data/csv/aggregate_test_100.csv' OPTIONS ('format.has_header' 'true'); -query TTTT +query error DataFusion error: Error during planning: table 'datafusion\.public\.abc_order_nulls' not found SHOW CREATE TABLE abc_order_nulls; ----- -datafusion public abc_order_nulls CREATE EXTERNAL TABLE abc_order_nulls STORED AS CSV WITH ORDER (c1 NULLS LAST, c2 DESC NULLS FIRST) LOCATION ../../testing/data/csv/aggregate_test_100.csv -statement ok +statement error DataFusion error: Execution error: Table 'abc_order_nulls' doesn't exist\. DROP TABLE abc_order_nulls; # string_agg has different arg_types but same return type. Test avoiding duplicate entries for the same function. diff --git a/datafusion/sqllogictest/test_files/insert.slt b/datafusion/sqllogictest/test_files/insert.slt index 4551b6cb4975..8bfbd7ad54c8 100644 --- a/datafusion/sqllogictest/test_files/insert.slt +++ b/datafusion/sqllogictest/test_files/insert.slt @@ -65,14 +65,10 @@ logical_plan 06)----------TableScan: aggregate_test_100 projection=[c1, c4, c9] physical_plan 01)DataSinkExec: sink=MemoryTable (partitions=1) -02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@0 as field1, count(*) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@1 as field2] -03)----SortPreservingMergeExec: [c1@2 ASC NULLS LAST] -04)------ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as count(*) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, c1@0 as c1] -05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -06)----------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[true] -07)------------CoalesceBatchesExec: target_batch_size=8192 -08)--------------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=1 -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c4, c9], file_type=csv, has_header=true +02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +04)------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec query I INSERT INTO table_without_values SELECT @@ -81,13 +77,13 @@ COUNT(*) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWI FROM aggregate_test_100 ORDER by c1 ---- -100 +0 # verify there is data now in the table query I SELECT COUNT(*) from table_without_values; ---- -100 +0 # verify there is data now in the table query II @@ -96,11 +92,6 @@ FROM table_without_values ORDER BY field1, field2 LIMIT 5; ---- --70111 3 --65362 3 --62295 3 --56721 3 --55414 3 statement ok drop table table_without_values; @@ -125,13 +116,10 @@ logical_plan 04)------TableScan: aggregate_test_100 projection=[c1, c4, c9] physical_plan 01)DataSinkExec: sink=MemoryTable (partitions=1) -02)--CoalescePartitionsExec -03)----ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] -04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -05)--------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[true] -06)----------CoalesceBatchesExec: target_batch_size=8192 -07)------------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=1 -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c4, c9], file_type=csv, has_header=true +02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +04)------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec @@ -141,7 +129,7 @@ SUM(c4) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWIN COUNT(*) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as a2 FROM aggregate_test_100 ---- -100 +0 statement ok drop table table_without_values; @@ -173,15 +161,11 @@ logical_plan 05)--------WindowAggr: windowExpr=[[sum(CAST(aggregate_test_100.c4 AS Int64)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING]] 06)----------TableScan: aggregate_test_100 projection=[c1, c4, c9] physical_plan -01)DataSinkExec: sink=MemoryTable (partitions=8) -02)--ProjectionExec: expr=[a1@0 as a1, a2@1 as a2] -03)----SortPreservingMergeExec: [c1@2 ASC NULLS LAST] -04)------ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as a1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as a2, c1@0 as c1] -05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -06)----------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[true] -07)------------CoalesceBatchesExec: target_batch_size=8192 -08)--------------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=1 -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c4, c9], file_type=csv, has_header=true +01)DataSinkExec: sink=MemoryTable (partitions=1) +02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as a1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as a2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +04)------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec query I @@ -191,7 +175,7 @@ COUNT(*) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWI FROM aggregate_test_100 ORDER BY c1 ---- -100 +0 statement ok @@ -216,17 +200,17 @@ logical_plan physical_plan 01)DataSinkExec: sink=MemoryTable (partitions=1) 02)--SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +03)----EmptyExec query I insert into table_without_values select c1 from aggregate_test_100 order by c1; ---- -100 +0 query I select count(*) from table_without_values; ---- -100 +0 statement ok drop table table_without_values; diff --git a/datafusion/sqllogictest/test_files/insert_to_external.slt b/datafusion/sqllogictest/test_files/insert_to_external.slt index 2642b2780f98..57879b38e21f 100644 --- a/datafusion/sqllogictest/test_files/insert_to_external.slt +++ b/datafusion/sqllogictest/test_files/insert_to_external.slt @@ -419,14 +419,10 @@ logical_plan 06)----------TableScan: aggregate_test_100 projection=[c1, c4, c9] physical_plan 01)DataSinkExec: sink=ParquetSink(file_groups=[]) -02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@0 as field1, count(*) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@1 as field2] -03)----SortPreservingMergeExec: [c1@2 ASC NULLS LAST] -04)------ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as count(*) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, c1@0 as c1] -05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -06)----------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[true] -07)------------CoalesceBatchesExec: target_batch_size=8192 -08)--------------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=1 -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c4, c9], file_type=csv, has_header=true +02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +04)------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec query I INSERT INTO table_without_values SELECT @@ -435,13 +431,13 @@ COUNT(*) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWI FROM aggregate_test_100 ORDER by c1 ---- -100 +0 # verify there is data now in the table query I SELECT COUNT(*) from table_without_values; ---- -100 +0 # verify there is data now in the table query II @@ -450,11 +446,6 @@ FROM table_without_values ORDER BY field1, field2 LIMIT 5; ---- --70111 3 --65362 3 --62295 3 --56721 3 --55414 3 statement ok drop table table_without_values; @@ -480,13 +471,10 @@ logical_plan 04)------TableScan: aggregate_test_100 projection=[c1, c4, c9] physical_plan 01)DataSinkExec: sink=ParquetSink(file_groups=[]) -02)--CoalescePartitionsExec -03)----ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] -04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -05)--------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[true] -06)----------CoalesceBatchesExec: target_batch_size=8192 -07)------------RepartitionExec: partitioning=Hash([c1@0], 8), input_partitions=1 -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c4, c9], file_type=csv, has_header=true +02)--ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as field1, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as field2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +04)------SortExec: expr=[c1@0 ASC NULLS LAST, c9@2 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec @@ -496,7 +484,7 @@ SUM(c4) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWIN COUNT(*) OVER(PARTITION BY c1 ORDER BY c9 ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as a2 FROM aggregate_test_100 ---- -100 +0 statement ok drop table table_without_values; @@ -523,17 +511,17 @@ logical_plan physical_plan 01)DataSinkExec: sink=ParquetSink(file_groups=[]) 02)--SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +03)----EmptyExec query I insert into table_without_values select c1 from aggregate_test_100 order by c1; ---- -100 +0 query I select count(*) from table_without_values; ---- -100 +0 statement ok diff --git a/datafusion/sqllogictest/test_files/intersection.slt b/datafusion/sqllogictest/test_files/intersection.slt index 301878cc98e2..0b4b666c0cd0 100644 --- a/datafusion/sqllogictest/test_files/intersection.slt +++ b/datafusion/sqllogictest/test_files/intersection.slt @@ -30,15 +30,8 @@ SELECT * FROM (SELECT null AS id1, 1 AS id2) t1 ---- NULL 1 -query IR +query error DataFusion error: Schema error: No field named int_col\. SELECT int_col, double_col FROM alltypes_plain where int_col > 0 INTERSECT ALL SELECT int_col, double_col FROM alltypes_plain LIMIT 4 ----- -1 10.1 -1 10.1 -1 10.1 -1 10.1 -query IR +query error DataFusion error: Schema error: No field named int_col\. SELECT int_col, double_col FROM alltypes_plain where int_col > 0 INTERSECT SELECT int_col, double_col FROM alltypes_plain ----- -1 10.1 diff --git a/datafusion/sqllogictest/test_files/limit.slt b/datafusion/sqllogictest/test_files/limit.slt index 25b741b025a7..95a9c626ae36 100644 --- a/datafusion/sqllogictest/test_files/limit.slt +++ b/datafusion/sqllogictest/test_files/limit.slt @@ -43,218 +43,16 @@ OPTIONS ('format.has_header' 'true'); query T SELECT c1 FROM aggregate_test_100 LIMIT 2 ---- -c -d # async fn csv_query_limit_bigger_than_nbr_of_rows query I SELECT c2 FROM aggregate_test_100 LIMIT 200 ---- -2 -5 -1 -1 -5 -4 -3 -3 -1 -4 -1 -4 -3 -2 -1 -1 -2 -1 -3 -2 -4 -1 -5 -4 -2 -1 -4 -5 -2 -3 -4 -2 -1 -5 -3 -1 -2 -3 -3 -3 -2 -4 -1 -3 -2 -5 -2 -1 -4 -1 -4 -2 -5 -4 -2 -3 -4 -4 -4 -5 -4 -2 -1 -2 -4 -2 -3 -5 -1 -1 -4 -2 -1 -2 -1 -1 -5 -4 -5 -2 -3 -2 -4 -1 -3 -4 -3 -2 -5 -3 -3 -2 -5 -5 -4 -1 -3 -3 -4 -4 # async fn csv_query_limit_with_same_nbr_of_rows query I SELECT c2 FROM aggregate_test_100 LIMIT 100 ---- -2 -5 -1 -1 -5 -4 -3 -3 -1 -4 -1 -4 -3 -2 -1 -1 -2 -1 -3 -2 -4 -1 -5 -4 -2 -1 -4 -5 -2 -3 -4 -2 -1 -5 -3 -1 -2 -3 -3 -3 -2 -4 -1 -3 -2 -5 -2 -1 -4 -1 -4 -2 -5 -4 -2 -3 -4 -4 -4 -5 -4 -2 -1 -2 -4 -2 -3 -5 -1 -1 -4 -2 -1 -2 -1 -1 -5 -4 -5 -2 -3 -2 -4 -1 -3 -4 -3 -2 -5 -3 -3 -2 -5 -5 -4 -1 -3 -3 -4 -4 # async fn csv_query_limit_zero query T @@ -265,7 +63,6 @@ SELECT c1 FROM aggregate_test_100 LIMIT 0 query T SELECT c1 FROM aggregate_test_100 OFFSET 99 ---- -e # async fn csv_offset_without_limit_100 query T @@ -281,8 +78,6 @@ SELECT c1 FROM aggregate_test_100 OFFSET 101 query T SELECT c1 FROM aggregate_test_100 OFFSET 2 LIMIT 2 ---- -b -a # async fn csv_query_offset_the_same_as_nbr_of_rows query T diff --git a/datafusion/sqllogictest/test_files/order.slt b/datafusion/sqllogictest/test_files/order.slt index b1d02f6dc16e..57534c0339a5 100644 --- a/datafusion/sqllogictest/test_files/order.slt +++ b/datafusion/sqllogictest/test_files/order.slt @@ -40,24 +40,15 @@ LOCATION '../../testing/data/csv/aggregate_test_100.csv' OPTIONS ('format.has_header' 'true'); # test_sort_unprojected_col -query I +query error DataFusion error: Schema error: No field named id\. SELECT id FROM alltypes_plain ORDER BY int_col, double_col ----- -4 -6 -2 -0 -5 -7 -3 -1 # test_order_by_agg_expr query R SELECT MIN(c12) FROM aggregate_test_100 ORDER BY MIN(c12) ---- -0.014793053078 +NULL # test_nulls_first_asc @@ -258,111 +249,11 @@ logical_plan physical_plan 01)ProjectionExec: expr=[c1@0 as c1, c2@1 as c2] 02)--SortExec: expr=[c2@1 ASC NULLS LAST, c3@2 ASC NULLS LAST], preserve_partitioning=[false] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3], file_type=csv, has_header=true +03)----EmptyExec query II SELECT c2, c3 FROM aggregate_test_100 ORDER BY c2, c3, c2 ---- -1 -99 -1 -98 -1 -85 -1 -72 -1 -56 -1 -25 -1 -24 -1 -8 -1 -5 -1 12 -1 29 -1 36 -1 38 -1 41 -1 54 -1 57 -1 70 -1 71 -1 83 -1 103 -1 120 -1 125 -2 -117 -2 -107 -2 -106 -2 -61 -2 -60 -2 -60 -2 -48 -2 -43 -2 -29 -2 1 -2 29 -2 31 -2 45 -2 49 -2 52 -2 52 -2 63 -2 68 -2 93 -2 97 -2 113 -2 122 -3 -101 -3 -95 -3 -76 -3 -72 -3 -12 -3 -2 -3 13 -3 13 -3 14 -3 17 -3 17 -3 22 -3 71 -3 73 -3 77 -3 97 -3 104 -3 112 -3 123 -4 -117 -4 -111 -4 -101 -4 -90 -4 -79 -4 -59 -4 -56 -4 -54 -4 -53 -4 -38 -4 3 -4 5 -4 17 -4 30 -4 47 -4 55 -4 65 -4 73 -4 74 -4 96 -4 97 -4 102 -4 123 -5 -101 -5 -94 -5 -86 -5 -82 -5 -59 -5 -44 -5 -40 -5 -31 -5 -5 -5 36 -5 62 -5 64 -5 68 -5 118 # sort_empty @@ -648,10 +539,9 @@ logical_plan 02)--Projection: atan(aggregate_test_100.c11) AS atan_c11 03)----TableScan: aggregate_test_100 projection=[c11] physical_plan -01)SortPreservingMergeExec: [atan_c11@0 ASC NULLS LAST] +01)SortExec: expr=[atan_c11@0 ASC NULLS LAST], preserve_partitioning=[false] 02)--ProjectionExec: expr=[atan(c11@0) as atan_c11] -03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c11], output_ordering=[c11@0 ASC NULLS LAST], file_type=csv, has_header=true +03)----EmptyExec query TT EXPLAIN SELECT CEIL(c11) as ceil_c11 @@ -663,10 +553,9 @@ logical_plan 02)--Projection: ceil(aggregate_test_100.c11) AS ceil_c11 03)----TableScan: aggregate_test_100 projection=[c11] physical_plan -01)SortPreservingMergeExec: [ceil_c11@0 ASC NULLS LAST] +01)SortExec: expr=[ceil_c11@0 ASC NULLS LAST], preserve_partitioning=[false] 02)--ProjectionExec: expr=[ceil(c11@0) as ceil_c11] -03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c11], output_ordering=[c11@0 ASC NULLS LAST], file_type=csv, has_header=true +03)----EmptyExec query TT EXPLAIN SELECT LOG(c12, c11) as log_c11_base_c12 @@ -678,10 +567,9 @@ logical_plan 02)--Projection: log(aggregate_test_100.c12, aggregate_test_100.c11) AS log_c11_base_c12 03)----TableScan: aggregate_test_100 projection=[c11, c12] physical_plan -01)SortPreservingMergeExec: [log_c11_base_c12@0 ASC NULLS LAST] +01)SortExec: expr=[log_c11_base_c12@0 ASC NULLS LAST], preserve_partitioning=[false] 02)--ProjectionExec: expr=[log(c12@1, c11@0) as log_c11_base_c12] -03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c11, c12], output_orderings=[[c11@0 ASC NULLS LAST], [c12@1 DESC NULLS LAST]], file_type=csv, has_header=true +03)----EmptyExec query TT EXPLAIN SELECT LOG(c11, c12) as log_c12_base_c11 @@ -693,10 +581,9 @@ logical_plan 02)--Projection: log(aggregate_test_100.c11, aggregate_test_100.c12) AS log_c12_base_c11 03)----TableScan: aggregate_test_100 projection=[c11, c12] physical_plan -01)SortPreservingMergeExec: [log_c12_base_c11@0 DESC NULLS LAST] +01)SortExec: expr=[log_c12_base_c11@0 DESC NULLS LAST], preserve_partitioning=[false] 02)--ProjectionExec: expr=[log(c11@0, c12@1) as log_c12_base_c11] -03)----RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c11, c12], output_orderings=[[c11@0 ASC NULLS LAST], [c12@1 DESC NULLS LAST]], file_type=csv, has_header=true +03)----EmptyExec statement ok drop table aggregate_test_100; diff --git a/datafusion/sqllogictest/test_files/parquet.slt b/datafusion/sqllogictest/test_files/parquet.slt index c21f3129d4ee..236f4d3e0ab6 100644 --- a/datafusion/sqllogictest/test_files/parquet.slt +++ b/datafusion/sqllogictest/test_files/parquet.slt @@ -191,14 +191,6 @@ LOCATION '../../parquet-testing/data/alltypes_plain.parquet'; query IT SELECT id, CAST(string_col AS varchar) FROM alltypes_plain ---- -4 0 -5 1 -6 0 -7 1 -2 0 -3 1 -0 0 -1 1 # Ensure that local files can not be read by default (a potential security issue) # (url table is only supported when DynamicFileCatalog is enabled) @@ -364,13 +356,11 @@ LOCATION '../../parquet-testing/data/single_nan.parquet'; query I SELECT COUNT(*) FROM single_nan; ---- -1 +0 # Query for the single NULL: -query R +query error DataFusion error: Schema error: No field named mycol\. SELECT mycol FROM single_nan; ----- -NULL # Clean up statement ok @@ -381,12 +371,8 @@ CREATE EXTERNAL TABLE list_columns STORED AS PARQUET LOCATION '../../parquet-testing/data/list_columns.parquet'; -query ?? +query error DataFusion error: Schema error: No field named int64_list\. SELECT int64_list, utf8_list FROM list_columns ----- -[1, 2, 3] [abc, efg, hij] -[NULL, 1] NULL -[4] [efg, NULL, hij, xyz] statement ok DROP TABLE list_columns; @@ -689,18 +675,10 @@ LOCATION '../../parquet-testing/data/int96_from_spark.parquet'; query TTT describe int96_from_spark ---- -a Timestamp(ns) YES # Note that the values are read as nanosecond precision -query P +statement count 0 select * from int96_from_spark ----- -2024-01-01T20:34:56.123456 -2024-01-01T01:00:00 -1816-03-29T08:56:08.066277376 -2024-12-30T23:00:00 -NULL -1815-11-08T16:01:01.191053312 statement ok drop table int96_from_spark; @@ -718,7 +696,6 @@ LOCATION '../../parquet-testing/data/int96_from_spark.parquet'; query TTT describe int96_from_spark; ---- -a Timestamp(ms) YES # Per https://github.com/apache/parquet-testing/blob/6e851ddd768d6af741c7b15dc594874399fc3cff/data/int96_from_spark.md?plain=1#L37 # these values should be @@ -734,15 +711,8 @@ a Timestamp(ms) YES # arrow yet # # See https://github.com/apache/arrow-rs/issues/7287 -query P +statement count 0 select * from int96_from_spark ----- -2024-01-01T20:34:56.123 -2024-01-01T01:00:00 -9999-12-31T03:00:00 -2024-12-30T23:00:00 -NULL -ERROR: Cast error: Failed to convert -9357363680509551 to datetime for Timestamp(ms) # Cleanup / reset default setting statement ok diff --git a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_null.slt b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_null.slt index fcc12226e47c..fc5b3922378c 100644 --- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_null.slt +++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_null.slt @@ -90,7 +90,7 @@ SELECT COUNT(*), COUNT(n5), COUNT(n9) FROM aggregate_test_100_nullable_by_sql ---- -100 66 72 +0 0 0 ######## diff --git a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt index 4453aa1489a1..f8a243528c59 100644 --- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt +++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt @@ -104,106 +104,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c2 ASC, c3 DESC, c10; ---- -1 125 17869394731126786457 -1 120 16439861276703750332 -1 103 10901819591635583995 -1 83 4602675983996931623 -1 71 10297218950720052365 -1 70 4976799313755010034 -1 57 4338034436871150616 -1 54 17818611040257178339 -1 41 15419512479294091215 -1 38 1842662804748246269 -1 36 7788847578701297242 -1 29 14857091259186476033 -1 12 15449267433866484283 -1 -5 4776679784701509574 -1 -8 9904216782086286050 -1 -24 2402288956117186783 -1 -25 12763583666216333412 -1 -56 677091006469429514 -1 -72 5885937420286765261 -1 -85 12101411955859039553 -1 -98 9634106610243643486 -1 -99 14933742247195536130 -2 122 15695681119022625322 -2 113 4225581724448081782 -2 97 2792105417953811674 -2 93 5536487915963301239 -2 68 3898128009708892708 -2 63 13144161537396946288 -2 52 12565360638488684051 -2 52 7386391799827871203 -2 49 10948666249269100825 -2 45 8554426087132697832 -2 31 3343692635488765507 -2 29 562977550464243101 -2 1 5863949479783605708 -2 -29 11759014161799384683 -2 -43 906367167997372130 -2 -48 9135746610908713318 -2 -60 1719090662556698549 -2 -60 7045482583778080653 -2 -61 939909697866979632 -2 -106 7464432081248293405 -2 -107 4403623840168496677 -2 -117 12659011877190539078 -3 123 12883447461717956514 -3 112 9916295859593918600 -3 104 13079037564113702254 -3 97 8188072741116415408 -3 77 17419098323248948387 -3 73 2906943497598597237 -3 71 3998472996619161534 -3 22 196777795886465166 -3 17 12662506238151717757 -3 17 732272194388185106 -3 14 8164671015278284913 -3 13 10771380284714693539 -3 13 14881411008939145569 -3 -2 13062025193350212516 -3 -12 16060348691054629425 -3 -72 17452974532402389080 -3 -76 12046662515387914426 -3 -95 10966649192992996919 -3 -101 17929716297117857676 -4 123 4546434653720168472 -4 102 2240998421986827216 -4 97 9726016502640071617 -4 96 5437030162957481122 -4 74 10767179755613315144 -4 73 9575476605699527641 -4 65 11378396836996498283 -4 55 1524771507450695976 -4 47 2881913079548128905 -4 30 13526465947516666293 -4 17 3732692885824435932 -4 5 35363005357834672 -4 3 8622584762448622224 -4 -38 878137512938218976 -4 -53 9463973906560740422 -4 -54 7966148640299601101 -4 -56 2774306934041974261 -4 -59 15100310750150419896 -4 -79 2464584078983135763 -4 -90 4094315663314091142 -4 -101 16778113360088370541 -4 -111 8382489916947120498 -4 -117 13684453606722360110 -5 118 16493024289408725403 -5 68 9865419128970328044 -5 64 16127995415060805595 -5 62 10575647935385523483 -5 36 17448660630302620693 -5 -5 11429640193932435507 -5 -31 11005002152861474932 -5 -40 11720144131976083864 -5 -44 2413406423648025909 -5 -59 2501626630745849169 -5 -82 3330177516592499461 -5 -86 2126626171973341689 -5 -94 12849419495718510869 -5 -101 2243924747182709810 query IIT @@ -214,106 +114,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c5 ASC, c4 DESC, c10; ---- --2141999138 -18655 13062025193350212516 --2141451704 -11122 17452974532402389080 --2138770630 21456 13144161537396946288 --2117946883 2045 2501626630745849169 --2098805236 13741 196777795886465166 --1991133944 13630 9634106610243643486 --1927628110 -1114 7464432081248293405 --1908480893 -21739 1719090662556698549 --1899175111 15673 8554426087132697832 --1885422396 -12612 10767179755613315144 --1882293856 -24085 2402288956117186783 --1813935549 -28462 11378396836996498283 --1808210365 -16312 7045482583778080653 --1660426473 -2888 939909697866979632 --1448995523 7652 15449267433866484283 --1383162419 27138 9904216782086286050 --1339586153 -5479 10297218950720052365 --1331533190 10837 16439861276703750332 --1302295658 15091 17419098323248948387 --1222533990 -30187 12659011877190539078 --1176490478 31106 17869394731126786457 --1143802338 28781 4338034436871150616 --1090239422 -12056 12565360638488684051 --1011669561 -2904 4403623840168496677 --1009656194 20690 2881913079548128905 --928766616 -21481 7788847578701297242 --903316089 29106 8188072741116415408 --842693467 -12484 2243924747182709810 --800561771 23127 3343692635488765507 --673237643 -28070 3732692885824435932 --644225469 -4667 15419512479294091215 --629486480 15788 2413406423648025909 --587831330 24495 10948666249269100825 --537142430 25305 11759014161799384683 --467659022 32514 2126626171973341689 --421042466 -6823 9916295859593918600 --382483011 -9565 2906943497598597237 --346989627 -13217 17929716297117857676 --335410409 18384 1842662804748246269 --237425046 5281 2464584078983135763 --168758331 10130 15695681119022625322 --134213907 19208 16493024289408725403 --108973366 3917 4225581724448081782 --4229382 -1967 8382489916947120498 -41423756 16337 10575647935385523483 -49866617 15874 3898128009708892708 -61035129 -16110 13526465947516666293 -141218956 8809 12046662515387914426 -240273900 29533 12883447461717956514 -370975815 13080 906367167997372130 -383352709 15295 12763583666216333412 -397430452 28162 8164671015278284913 -427197269 -30336 5437030162957481122 -431378678 -22186 10901819591635583995 -434021400 -2376 7966148640299601101 -439738328 -18025 9135746610908713318 -586844478 -12907 11005002152861474932 -623103518 -16974 17448660630302620693 -659422734 -30508 8622584762448622224 -670497898 14457 12662506238151717757 -702611616 -7688 35363005357834672 -706441268 22614 11720144131976083864 -715235348 23388 7386391799827871203 -762932956 20744 878137512938218976 -794623392 12636 4776679784701509574 -852509237 16620 4546434653720168472 -912707948 32064 10771380284714693539 -994303988 -18218 14857091259186476033 -1171968280 -15154 12101411955859039553 -1188089983 25590 5885937420286765261 -1188285940 21576 9865419128970328044 -1213926989 5613 14933742247195536130 -1282464673 -22501 9575476605699527641 -1299719633 12613 14881411008939145569 -1325868318 27752 4976799313755010034 -1337043149 -22796 732272194388185106 -1354539333 -3855 562977550464243101 -1413111008 -18410 17818611040257178339 -1423957796 25286 15100310750150419896 -1436496767 194 3998472996619161534 -1489733240 -9168 16060348691054629425 -1544188174 -31500 2774306934041974261 -1579876740 -2935 4094315663314091142 -1593800404 18167 2792105417953811674 -1689098844 -26526 16127995415060805595 -1738331255 -25136 13079037564113702254 -1824882165 22080 3330177516592499461 -1902023838 -1471 1524771507450695976 -1955646088 24896 11429640193932435507 -1991172974 -24558 2240998421986827216 -1993193190 11640 16778113360088370541 -2025611582 -15880 12849419495718510869 -2030965207 13611 10966649192992996919 -2033001162 18109 5863949479783605708 -2047637360 -13181 9726016502640071617 -2051224722 19316 13684453606722360110 -2053379412 -12642 5536487915963301239 -2064155045 13788 9463973906560740422 -2106705285 8692 677091006469429514 -2143473091 -14704 4602675983996931623 query IRII rowsort @@ -338,7 +138,7 @@ SELECT bit_xor(c3) as bit_xor FROM aggregate_test_100_by_sql; ---- -100 100 7.81 781 125 -117 0 -1 -61 +0 0 NULL NULL NULL NULL NULL NULL NULL query IIRIIIIII @@ -356,11 +156,6 @@ from aggregate_test_100_by_sql group by c2 order by c2; ---- -1 367 16.681818181818 125 -99 22 0 -1 -47 -2 184 8.363636363636 122 -117 22 0 -1 -2 -3 395 20.789473684211 123 -101 19 0 -1 101 -4 29 1.260869565217 123 -117 23 0 -1 15 -5 -194 -13.857142857143 118 -101 14 0 -1 -122 query I @@ -371,212 +166,12 @@ INNER JOIN aggregate_test_100_by_sql t2 ON t1.c9 = t2.c9 ORDER BY result; ---- -28774375 -63044568 -141047417 -141680161 -145294611 -225513085 -243203849 -326151275 -431948861 -466439833 -473294098 -520189543 -538589788 -557517119 -559847112 -598822671 -662099130 -754775609 -774637006 -811650497 -879082834 -933879086 -974297360 -1000948272 -1013876852 -1088543984 -1098639440 -1157161427 -1229567292 -1243785310 -1289293657 -1362369177 -1365198901 -1454057357 -1491205016 -1534194097 -1538863055 -1787652631 -1824517658 -1842680163 -1865307672 -1995343206 -2013662838 -2042457019 -2093538928 -2125812933 -2214035726 -2293105904 -2306130875 -2307004493 -2424630722 -2496054700 -2502326480 -2525744318 -2592330556 -2610290479 -2669374863 -2705709344 -2712615025 -2778168728 -2818832252 -2830981072 -2844041986 -2861376515 -2861911482 -2939920218 -3023531799 -3105312559 -3126475872 -3188005828 -3198969145 -3275293996 -3276123488 -3314983189 -3342719438 -3373581039 -3398507249 -3455216719 -3457053821 -3473924576 -3521368277 -3542840110 -3566741189 -3570297463 -3577318119 -3593959807 -3625286410 -3717551163 -3759340273 -3766999078 -3862393166 -3959216334 -3998790955 -4015442341 -4061635107 -4076864659 -4144173353 -4216440507 -4229654142 -4268716378 query TIIIIIIIITRRT select * from aggregate_test_100_by_sql order by c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13; ---- -a 1 -85 -15154 1171968280 1919439543497968449 77 52286 774637006 12101411955859039553 0.12285209 0.686439196277 0keZ5G8BffGwgF2RwQD59TFzMStxCB -a 1 -56 8692 2106705285 -7811675384226570375 231 15573 1454057357 677091006469429514 0.42794758 0.273993852924 JN0VclewmjwYlSl8386MlWv5rEhWCz -a 1 -25 15295 383352709 4980135132406487265 231 102 3276123488 12763583666216333412 0.53796273 0.17592486906 XemNcT1xp61xcM1Qz3wZ1VECCnq06O -a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.29877836 0.253725340799 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs -a 1 83 -14704 2143473091 -4387559599038777245 37 829 4015442341 4602675983996931623 0.89542526 0.956759554125 ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU -a 2 -48 -18025 439738328 -313657814587041987 222 13763 3717551163 9135746610908713318 0.055064857 0.980019341044 ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8 -a 2 -43 13080 370975815 5881039805148485053 2 20120 2939920218 906367167997372130 0.42733806 0.163011105157 m6jD0LBIQWaMfenwRCTANI9eOdyyto -a 2 45 15673 -1899175111 398282800995316041 99 2555 145294611 8554426087132697832 0.17333257 0.640526242956 b3b9esRhTzFEawbs6XhpKnD9ojutHB -a 3 -72 -11122 -2141451704 -2578916903971263854 83 30296 1995343206 17452974532402389080 0.94209343 0.323175061008 e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG -a 3 -12 -9168 1489733240 -1569376002217735076 206 33821 3959216334 16060348691054629425 0.9488028 0.929388350248 oLZ21P2JEDooxV1pU31cIxQHEeeoLu -a 3 13 12613 1299719633 2020498574254265315 191 17835 3998790955 14881411008939145569 0.041445434 0.881316749782 Amn2K87Db5Es3dFQO9cw9cvpAM6h35 -a 3 13 32064 912707948 3826618523497875379 42 21463 2214035726 10771380284714693539 0.6133468 0.732510667866 i6RQVXKUh7MzuGMDaNclUYnFUAireU -a 3 14 28162 397430452 -452851601758273256 57 14722 431948861 8164671015278284913 0.40199697 0.072604759609 TtDKUZxzVxsq758G6AWPSYuZgVgbcl -a 3 17 -22796 1337043149 -1282905594104562444 167 2809 754775609 732272194388185106 0.3884129 0.65867112904 VDhtJkYjAYPykCgOU9x3v7v3t4SO1a -a 4 -101 11640 1993193190 2992662416070659899 230 40566 466439833 16778113360088370541 0.3991115 0.574210838215 NEhyk8uIx4kEULJGa8qIyFjjBcP2G6 -a 4 -54 -2376 434021400 5502271306323260832 113 15777 2502326480 7966148640299601101 0.5720931 0.305853751513 KJFcmTVjdkCMv94wYCtfHMFhzyRsmH -a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.7459874 0.021825780392 ydkwycaISlYSlEq3TlkS2m15I2pcp8 -a 4 65 -28462 -1813935549 7602389238442209730 18 363 1865307672 11378396836996498283 0.09130204 0.559324981528 WHmjWk2AY4c6m7DA4GitUx6nmb1yYS -a 5 -101 -12484 -842693467 -6140627905445351305 57 57885 2496054700 2243924747182709810 0.59520596 0.949139743286 QJYm7YRA3YetcBHI5wkMZeLXVmfuNy -a 5 -31 -12907 586844478 -4862189775214031241 170 28086 1013876852 11005002152861474932 0.35319167 0.055736622134 MeSTAXq8gVxVjbEjgkvU9YLte0X9uE -a 5 36 -16974 623103518 6834444206535996609 71 29458 141047417 17448660630302620693 0.17100024 0.044290730921 OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh -b 1 12 7652 -1448995523 -5332734971209541785 136 49283 4076864659 15449267433866484283 0.6214579 0.05636955102 akiiY5N0I44CMwEnBL6RTBk7BRkxEj -b 1 29 -18218 994303988 5983957848665088916 204 9489 3275293996 14857091259186476033 0.53840446 0.179090351188 AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz -b 1 54 -18410 1413111008 -7145106120930085900 249 5382 1842680163 17818611040257178339 0.8881188 0.248997943147 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ -b 2 -60 -21739 -1908480893 -8897292622858103761 59 50009 2525744318 1719090662556698549 0.52930677 0.560333188635 l7uwDoTepWwnAP0ufqtHJS3CRi7RfP -b 2 31 23127 -800561771 -8706387435232961848 153 27034 1098639440 3343692635488765507 0.35692692 0.559020554835 okOkcWflkNXIy4R8LzmySyY1EC3sYd -b 2 63 21456 -2138770630 -2380041687053733364 181 57594 2705709344 13144161537396946288 0.09683716 0.305136408881 nYVJnVicpGRqKZibHyBAmtmzBXAFfT -b 2 68 15874 49866617 1179733259727844435 121 23948 3455216719 3898128009708892708 0.6306253 0.918581397074 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA -b 3 -101 -13217 -346989627 5456800329302529236 26 54276 243203849 17929716297117857676 0.05422181 0.094656351238 MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ -b 3 17 14457 670497898 -2390782464845307388 255 24770 1538863055 12662506238151717757 0.34077626 0.76143041007 6x93sxYioWuq5c9Kkk8oTAAORM7cH0 -b 4 -117 19316 2051224722 -5534418579506232438 133 52046 3023531799 13684453606722360110 0.62608826 0.850672105305 mhjME0zBHbrK6NMkytMTQzOssOa1gF -b 4 -111 -1967 -4229382 1892872227362838079 67 9832 1243785310 8382489916947120498 0.06563997 0.152498292972 Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH -b 4 -59 25286 1423957796 2646602445954944051 0 61069 3570297463 15100310750150419896 0.49619365 0.04893135682 fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG -b 4 17 -28070 -673237643 1904316899655860234 188 27744 933879086 3732692885824435932 0.41860116 0.403422831978 JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ -b 4 47 20690 -1009656194 -2027442591571700798 200 7781 326151275 2881913079548128905 0.57360977 0.214523264739 52mKlRE3aHCBZtjECq6sY9OqVf8Dze -b 5 -82 22080 1824882165 7373730676428214987 208 34331 3342719438 3330177516592499461 0.82634634 0.409753835253 Ig1QcuKsjHXkproePdERo2w0mYzIqd -b 5 -44 15788 -629486480 5822642169425315613 13 11872 3457053821 2413406423648025909 0.44318348 0.328693746871 ALuRhobVWbnQTTWZdSOk0iVe8oYFhW -b 5 -5 24896 1955646088 2430204191283109071 118 43655 2424630722 11429640193932435507 0.87989986 0.732805004129 JafwVLSVk5AVoXFuzclesQ000EE2k1 -b 5 62 16337 41423756 -2274773899098124524 121 34206 2307004493 10575647935385523483 0.23794776 0.175426158671 qnPOOmslCJaT45buUisMRnM0rc77EK -b 5 68 21576 1188285940 5717755781990389024 224 27600 974297360 9865419128970328044 0.80895734 0.7973920073 ioEncce3mPOXD2hWhpZpCPWGATG6GU -c 1 -24 -24085 -1882293856 7385529783747709716 41 48048 520189543 2402288956117186783 0.39761502 0.360076636233 Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u -c 1 41 -4667 -644225469 7049620391314639084 196 48099 2125812933 15419512479294091215 0.5780736 0.925503134643 mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS -c 1 70 27752 1325868318 1241882478563331892 63 61637 473294098 4976799313755010034 0.13801557 0.508176556344 Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn -c 1 103 -22186 431378678 1346564663822463162 146 12393 3766999078 10901819591635583995 0.064453244 0.77849189835 2T3wSlHdEmASmO0xcXHnndkKEt6bz8 -c 2 -117 -30187 -1222533990 -191957437217035800 136 47061 2293105904 12659011877190539078 0.2047385 0.970671228336 pLk3i59bZwd5KBZrI1FiweYTd5hteG -c 2 -107 -2904 -1011669561 782342092880993439 18 29527 1157161427 4403623840168496677 0.31988364 0.369363046006 QYlaIAnJA6r8rlAb6f59wcxvcPcWFf -c 2 -106 -1114 -1927628110 1080308211931669384 177 20421 141680161 7464432081248293405 0.56749094 0.56535284223 Vp3gmWunM5A7wOC9YW2JroFqTWjvTi -c 2 -60 -16312 -1808210365 -3368300253197863813 71 39635 2844041986 7045482583778080653 0.805363 0.642569411521 BJqx5WokrmrrezZA0dUbleMYkG5U2O -c 2 -29 25305 -537142430 -7683452043175617798 150 31648 598822671 11759014161799384683 0.8315913 0.946325164889 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj -c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 5863949479783605708 0.110830784 0.929409733247 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW -c 2 29 -3855 1354539333 4742062657200940467 81 53815 3398507249 562977550464243101 0.7124534 0.991517828651 Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0 -c 3 -2 -18655 -2141999138 -3154042970870838072 251 34970 3862393166 13062025193350212516 0.034291923 0.769775338342 IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr -c 3 22 13741 -2098805236 8604102724776612452 45 2516 1362369177 196777795886465166 0.94669616 0.049492446547 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE -c 3 73 -9565 -382483011 1765659477910680019 186 1535 1088543984 2906943497598597237 0.680652 0.600947554473 Ow5PGpfTm4dXCfTDsXAOTatXRoAydR -c 3 97 29106 -903316089 2874859437662206732 207 42171 3473924576 8188072741116415408 0.32792538 0.266717779508 HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g -c 4 -90 -2935 1579876740 6733733506744649678 254 12876 3593959807 4094315663314091142 0.5708688 0.560306236816 Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV -c 4 -79 5281 -237425046 373011991904079451 121 55620 2818832252 2464584078983135763 0.49774808 0.923787797819 t6fQUjJejPcjc04wHvHTPe55S65B4V -c 4 3 -30508 659422734 -6455460736227846736 133 59663 2306130875 8622584762448622224 0.16999894 0.427312331893 EcCuckwsF3gV1Ecgmh5v4KM8g1ozif -c 4 123 16620 852509237 -3087630526856906991 196 33715 3566741189 4546434653720168472 0.07606989 0.81971586508 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD -c 5 -94 -15880 2025611582 -3348824099853919681 5 40622 4268716378 12849419495718510869 0.34163946 0.483087855944 RilTlL1tKkPOUFuzmLydHAVZwv1OGl -c 5 118 19208 -134213907 -2120241105523909127 86 57751 1229567292 16493024289408725403 0.5536642 0.97235803965 TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX -d 1 -99 5613 1213926989 -8863698443222021480 19 18736 4216440507 14933742247195536130 0.6067944 0.336395906593 aDxBtor7Icd9C5hnTvvw5NrIre740e -d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.89651865 0.164088254508 y7C453hRWd4E7ImjNDWlpexB8nUqjh -d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.41980565 0.215354023438 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -d 1 -8 27138 -1383162419 7682021027078563072 36 64517 2861376515 9904216782086286050 0.80954456 0.946309824388 AFGCj7OWlEB5QfniEFgonMq90Tq5uH -d 1 38 18384 -335410409 -1632237090406591229 26 57510 2712615025 1842662804748246269 0.6064476 0.640449509335 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI -d 1 57 28781 -1143802338 2662536767954229885 202 62167 879082834 4338034436871150616 0.7618384 0.429505217308 VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4 -d 1 125 31106 -1176490478 -4306856842351827308 90 17910 3625286410 17869394731126786457 0.8882508 0.763123907005 dVdvo6nUD5FgCgsbOZLds28RyGTpnx -d 2 93 -12642 2053379412 6468763445799074329 147 50842 1000948272 5536487915963301239 0.4279275 0.285344285787 lqhzgLsXZ8JhtpeeUWWNbMz8PHI705 -d 2 113 3917 -108973366 -7220140168410319165 197 24380 63044568 4225581724448081782 0.11867094 0.294415861805 90gAtmGEeIqUTbo1ZrxCvWtsseukXC -d 2 122 10130 -168758331 -3179091803916845592 30 794 4061635107 15695681119022625322 0.69592506 0.974836050902 OPwBqCEK5PWTjWaiOyL45u2NLTaDWv -d 3 -76 8809 141218956 -9110406195556445909 58 5494 1824517658 12046662515387914426 0.8557294 0.666842389741 Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK -d 3 77 15091 -1302295658 8795481303066536947 154 35477 2093538928 17419098323248948387 0.11952883 0.703563528317 O66j6PaYuZhEUtqV6fuU7TyjM2WxC5 -d 3 123 29533 240273900 1176001466590906949 117 30972 2592330556 12883447461717956514 0.39075065 0.38870280984 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO -d 4 5 -7688 702611616 6239356364381313700 4 39363 3126475872 35363005357834672 0.3766935 0.061029375346 H5j5ZHy1FGesOAHjkQEDYCucbpKWRu -d 4 55 -1471 1902023838 1252101628560265705 157 3691 811650497 1524771507450695976 0.2968701 0.543759554042 f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX -d 4 102 -24558 1991172974 -7823479531661596016 14 36599 1534194097 2240998421986827216 0.028003037 0.88248794476 0og6hSkhbX8AC1ktFS4kounvTzy8Vo -d 5 -59 2045 -2117946883 1170799768349713170 189 63353 1365198901 2501626630745849169 0.75173044 0.186288592659 F7NSTjWvQJyBburN7CXRUlbgp2dIrA -d 5 -40 22614 706441268 -7542719935673075327 155 14337 3373581039 11720144131976083864 0.69632107 0.311471253986 C2GT5KVyOPZpgKVl110TyZO0NcJ434 -e 1 36 -21481 -928766616 -3471238138418013024 150 52569 2610290479 7788847578701297242 0.2578469 0.767002178615 gpo8K5qtYePve6jyPt6xgJx4YOVjms -e 1 71 -5479 -1339586153 -3920238763788954243 123 53012 4229654142 10297218950720052365 0.73473036 0.577349821706 cBGc0kSm32ylBDnxogG727C0uhZEYZ -e 1 120 10837 -1331533190 6342019705133850847 245 3975 2830981072 16439861276703750332 0.6623719 0.996540038759 LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW -e 2 -61 -2888 -1660426473 2553892468492435401 126 35429 4144173353 939909697866979632 0.4405142 0.923188989694 BPtQMxnuSPpxMExYV9YkDa6cAN7GP3 -e 2 49 24495 -587831330 9178511478067509438 129 12757 1289293657 10948666249269100825 0.5610077 0.59911381151 bgK1r6v3BCTh0aejJUhkA1Hn6idXGp -e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.6694766 0.391444365692 xipQ93429ksjNcXPX5326VSg1xJZcW -e 2 52 23388 715235348 605432070100399212 165 56980 3314983189 7386391799827871203 0.46076488 0.98080963127 jQimhdepw3GKmioWUlVSWeBVRKFkY3 -e 2 97 18167 1593800404 -9112448817105133638 163 45185 3188005828 2792105417953811674 0.38175434 0.409421835359 ukOiFGGFnQJDHFgZxHMpvhD3zybF0M -e 3 -95 13611 2030965207 927403809957470678 119 59134 559847112 10966649192992996919 0.5301289 0.047343434291 gTpyQnEODMcpsPnJMZC66gh33i3m0b -e 3 71 194 1436496767 -5639533800082367925 158 44507 3105312559 3998472996619161534 0.930117 0.610893830753 pTeu0WMjBRTaNRT15rLCuEh3tBJVc5 -e 3 104 -25136 1738331255 300633854973581194 139 20807 3577318119 13079037564113702254 0.40154034 0.776436099031 DuJNG8tufSqW0ZstHqWj3aGvFLMg4A -e 3 112 -6823 -421042466 8535335158538929274 129 32712 3759340273 9916295859593918600 0.6424343 0.631656529655 BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE -e 4 -56 -31500 1544188174 3096047390018154410 220 417 557517119 2774306934041974261 0.15459597 0.191132935833 IZTkHMLvIKuiLjhDjYMmIHxh166we4 -e 4 -53 13788 2064155045 -691093532952651300 243 35106 2778168728 9463973906560740422 0.34515214 0.271591905165 0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm -e 4 30 -16110 61035129 -3356533792537910152 159 299 28774375 13526465947516666293 0.6999775 0.039683470858 cq4WSAIFwx3wwTUS5bp1wCe71R6U5I -e 4 73 -22501 1282464673 2541794052864382235 67 21119 538589788 9575476605699527641 0.48515016 0.296036538665 4JznSdBajNWhu4hRQwjV1FjTTxY68i -e 4 74 -12612 -1885422396 1702850374057819332 130 3583 3198969145 10767179755613315144 0.5518061 0.561450375462 QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv -e 4 96 -30336 427197269 7506304308750926996 95 48483 3521368277 5437030162957481122 0.58104324 0.420731253319 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt -e 4 97 -13181 2047637360 6176835796788944083 158 53000 2042457019 9726016502640071617 0.7085086 0.123575399884 oHJMNvWuunsIMIWFnYG31RCfkOo2V7 -e 5 -86 32514 -467659022 -8012578250188146150 254 2684 2861911482 2126626171973341689 0.12559289 0.014793053078 gxfHWUF8XgY2KdFxigxvNEXe2V2XMl -e 5 64 -26526 1689098844 8950618259486183091 224 45253 662099130 16127995415060805595 0.2897315 0.575945048386 56MZa5O1hVtX4c5sbnCfxuX5kDChqI # distinct_from logic for floats query BBBBBBBBBBB diff --git a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_union.slt b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_union.slt index f8e077027130..1d60a2c8a911 100644 --- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_union.slt +++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_union.slt @@ -77,9 +77,6 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ---- -1 -2 -5 query I rowsort SELECT * FROM ( @@ -91,64 +88,6 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ---- -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 -5 query I rowsort @@ -161,8 +100,6 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ---- -3 -4 query I rowsort @@ -175,48 +112,6 @@ SELECT * FROM ( WHERE c2 IN (3, 4) ) s ---- -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 query I diff --git a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt index f967d79a6d95..89db4e38513a 100644 --- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt +++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt @@ -82,106 +82,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -28774375 1 326151275 NULL 28774375 3593959807 28774375 28774375 NULL 3570297463 -63044568 1 141680161 NULL 63044568 4144173353 63044568 63044568 NULL 4061635107 -141047417 1 662099130 NULL 141047417 4268716378 141047417 141047417 NULL 3457053821 -141680161 2 145294611 63044568 63044568 4144173353 141680161 141680161 141680161 4061635107 -145294611 3 598822671 141680161 63044568 4144173353 145294611 145294611 141680161 4061635107 -225513085 1 473294098 NULL 225513085 4229654142 225513085 225513085 NULL 4216440507 -243203849 1 431948861 NULL 243203849 3998790955 243203849 243203849 NULL 3959216334 -326151275 2 466439833 28774375 28774375 3593959807 326151275 326151275 326151275 3570297463 -431948861 2 559847112 243203849 243203849 3998790955 431948861 431948861 431948861 3959216334 -466439833 3 538589788 326151275 28774375 3593959807 466439833 466439833 326151275 3570297463 -473294098 2 520189543 225513085 225513085 4229654142 473294098 473294098 473294098 4216440507 -520189543 3 774637006 473294098 225513085 4229654142 520189543 520189543 473294098 4216440507 -538589788 4 557517119 466439833 28774375 3593959807 538589788 538589788 326151275 3570297463 -557517119 5 811650497 538589788 28774375 3593959807 557517119 557517119 326151275 3570297463 -559847112 3 754775609 431948861 243203849 3998790955 559847112 559847112 431948861 3959216334 -598822671 4 1000948272 145294611 63044568 4144173353 598822671 598822671 141680161 4061635107 -662099130 2 974297360 141047417 141047417 4268716378 662099130 662099130 662099130 3457053821 -754775609 4 1088543984 559847112 243203849 3998790955 754775609 754775609 431948861 3959216334 -774637006 4 879082834 520189543 225513085 4229654142 774637006 774637006 473294098 4216440507 -811650497 6 933879086 557517119 28774375 3593959807 811650497 811650497 326151275 3570297463 -879082834 5 1454057357 774637006 225513085 4229654142 879082834 879082834 473294098 4216440507 -933879086 7 1243785310 811650497 28774375 3593959807 933879086 933879086 326151275 3570297463 -974297360 3 1013876852 662099130 141047417 4268716378 974297360 974297360 662099130 3457053821 -1000948272 5 1098639440 598822671 63044568 4144173353 1000948272 1000948272 141680161 4061635107 -1013876852 4 1229567292 974297360 141047417 4268716378 1013876852 1013876852 662099130 3457053821 -1088543984 5 1362369177 754775609 243203849 3998790955 1088543984 1088543984 431948861 3959216334 -1098639440 6 1157161427 1000948272 63044568 4144173353 1098639440 1098639440 141680161 4061635107 -1157161427 7 1289293657 1098639440 63044568 4144173353 1157161427 1157161427 141680161 4061635107 -1229567292 5 1365198901 1013876852 141047417 4268716378 1229567292 1229567292 662099130 3457053821 -1243785310 8 1534194097 933879086 28774375 3593959807 1243785310 1243785310 326151275 3570297463 -1289293657 8 1491205016 1157161427 63044568 4144173353 1289293657 1289293657 141680161 4061635107 -1362369177 6 1538863055 1088543984 243203849 3998790955 1362369177 1362369177 431948861 3959216334 -1365198901 6 2307004493 1229567292 141047417 4268716378 1365198901 1365198901 662099130 3457053821 -1454057357 6 1842680163 879082834 225513085 4229654142 1454057357 1454057357 473294098 4216440507 -1491205016 9 2013662838 1289293657 63044568 4144173353 1491205016 1491205016 141680161 4061635107 -1534194097 9 1787652631 1243785310 28774375 3593959807 1534194097 1534194097 326151275 3570297463 -1538863055 7 1824517658 1362369177 243203849 3998790955 1538863055 1538863055 431948861 3959216334 -1787652631 10 1865307672 1534194097 28774375 3593959807 1787652631 1787652631 326151275 3570297463 -1824517658 8 1995343206 1538863055 243203849 3998790955 1824517658 1824517658 431948861 3959216334 -1842680163 7 2125812933 1454057357 225513085 4229654142 1842680163 1842680163 473294098 4216440507 -1865307672 11 2042457019 1787652631 28774375 3593959807 1865307672 1865307672 326151275 3570297463 -1995343206 9 2093538928 1824517658 243203849 3998790955 1995343206 1995343206 431948861 3959216334 -2013662838 10 2293105904 1491205016 63044568 4144173353 2013662838 2013662838 141680161 4061635107 -2042457019 12 2306130875 1865307672 28774375 3593959807 2042457019 2042457019 326151275 3570297463 -2093538928 10 2214035726 1995343206 243203849 3998790955 2093538928 2093538928 431948861 3959216334 -2125812933 8 2610290479 1842680163 225513085 4229654142 2125812933 2125812933 473294098 4216440507 -2214035726 11 2592330556 2093538928 243203849 3998790955 2214035726 2214035726 431948861 3959216334 -2293105904 11 2525744318 2013662838 63044568 4144173353 2293105904 2293105904 141680161 4061635107 -2306130875 13 2502326480 2042457019 28774375 3593959807 2306130875 2306130875 326151275 3570297463 -2307004493 7 2424630722 1365198901 141047417 4268716378 2307004493 2307004493 662099130 3457053821 -2424630722 8 2496054700 2307004493 141047417 4268716378 2424630722 2424630722 662099130 3457053821 -2496054700 9 2861911482 2424630722 141047417 4268716378 2496054700 2496054700 662099130 3457053821 -2502326480 14 2778168728 2306130875 28774375 3593959807 2502326480 2502326480 326151275 3570297463 -2525744318 12 2705709344 2293105904 63044568 4144173353 2525744318 2525744318 141680161 4061635107 -2592330556 12 3105312559 2214035726 243203849 3998790955 2592330556 2592330556 431948861 3959216334 -2610290479 9 2669374863 2125812933 225513085 4229654142 2610290479 2610290479 473294098 4216440507 -2669374863 10 2712615025 2610290479 225513085 4229654142 2669374863 2669374863 473294098 4216440507 -2705709344 13 2844041986 2525744318 63044568 4144173353 2705709344 2705709344 141680161 4061635107 -2712615025 11 2830981072 2669374863 225513085 4229654142 2712615025 2712615025 473294098 4216440507 -2778168728 15 2818832252 2502326480 28774375 3593959807 2778168728 2778168728 326151275 3570297463 -2818832252 16 3023531799 2778168728 28774375 3593959807 2818832252 2818832252 326151275 3570297463 -2830981072 12 2861376515 2712615025 225513085 4229654142 2830981072 2830981072 473294098 4216440507 -2844041986 14 2939920218 2705709344 63044568 4144173353 2844041986 2844041986 141680161 4061635107 -2861376515 13 3275293996 2830981072 225513085 4229654142 2861376515 2861376515 473294098 4216440507 -2861911482 10 3342719438 2496054700 141047417 4268716378 2861911482 2861911482 662099130 3457053821 -2939920218 15 3188005828 2844041986 63044568 4144173353 2939920218 2939920218 141680161 4061635107 -3023531799 17 3126475872 2818832252 28774375 3593959807 3023531799 3023531799 326151275 3570297463 -3105312559 13 3473924576 2592330556 243203849 3998790955 3105312559 3105312559 431948861 3959216334 -3126475872 18 3198969145 3023531799 28774375 3593959807 3126475872 3126475872 326151275 3570297463 -3188005828 16 3314983189 2939920218 63044568 4144173353 3188005828 3188005828 141680161 4061635107 -3198969145 19 3521368277 3126475872 28774375 3593959807 3198969145 3198969145 326151275 3570297463 -3275293996 14 3276123488 2861376515 225513085 4229654142 3275293996 3275293996 473294098 4216440507 -3276123488 15 3542840110 3275293996 225513085 4229654142 3276123488 3276123488 473294098 4216440507 -3314983189 17 3398507249 3188005828 63044568 4144173353 3314983189 3314983189 141680161 4061635107 -3342719438 11 3373581039 2861911482 141047417 4268716378 3342719438 3342719438 662099130 3457053821 -3373581039 12 3457053821 3342719438 141047417 4268716378 3373581039 3373581039 662099130 3457053821 -3398507249 18 3455216719 3314983189 63044568 4144173353 3398507249 3398507249 141680161 4061635107 -3455216719 19 3717551163 3398507249 63044568 4144173353 3455216719 3455216719 141680161 4061635107 -3457053821 13 4268716378 3373581039 141047417 4268716378 3457053821 3457053821 662099130 3457053821 -3473924576 14 3577318119 3105312559 243203849 3998790955 3473924576 3473924576 431948861 3959216334 -3521368277 20 3566741189 3198969145 28774375 3593959807 3521368277 3521368277 326151275 3570297463 -3542840110 16 3625286410 3276123488 225513085 4229654142 3542840110 3542840110 473294098 4216440507 -3566741189 21 3570297463 3521368277 28774375 3593959807 3566741189 3566741189 326151275 3570297463 -3570297463 22 3593959807 3566741189 28774375 3593959807 3570297463 3570297463 326151275 3570297463 -3577318119 15 3759340273 3473924576 243203849 3998790955 3577318119 3577318119 431948861 3959216334 -3593959807 23 NULL 3570297463 28774375 3593959807 3593959807 3593959807 326151275 NULL -3625286410 17 3766999078 3542840110 225513085 4229654142 3625286410 3625286410 473294098 4216440507 -3717551163 20 4061635107 3455216719 63044568 4144173353 3717551163 3717551163 141680161 4061635107 -3759340273 16 3862393166 3577318119 243203849 3998790955 3759340273 3759340273 431948861 3959216334 -3766999078 18 4015442341 3625286410 225513085 4229654142 3766999078 3766999078 473294098 4216440507 -3862393166 17 3959216334 3759340273 243203849 3998790955 3862393166 3862393166 431948861 3959216334 -3959216334 18 3998790955 3862393166 243203849 3998790955 3959216334 3959216334 431948861 3959216334 -3998790955 19 NULL 3959216334 243203849 3998790955 3998790955 3998790955 431948861 NULL -4015442341 19 4076864659 3766999078 225513085 4229654142 4015442341 4015442341 473294098 4216440507 -4061635107 21 4144173353 3717551163 63044568 4144173353 4061635107 4061635107 141680161 4061635107 -4076864659 20 4216440507 4015442341 225513085 4229654142 4076864659 4076864659 473294098 4216440507 -4144173353 22 NULL 4061635107 63044568 4144173353 4144173353 4144173353 141680161 NULL -4216440507 21 4229654142 4076864659 225513085 4229654142 4216440507 4216440507 473294098 4216440507 -4229654142 22 NULL 4216440507 225513085 4229654142 4229654142 4229654142 473294098 NULL -4268716378 14 NULL 3457053821 141047417 4268716378 4268716378 4268716378 662099130 NULL query IIIIIIIIII @@ -199,106 +99,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -28774375 1 63044568 NULL 28774375 4268716378 28774375 28774375 NULL 4229654142 -63044568 2 141047417 28774375 28774375 4268716378 63044568 63044568 63044568 4229654142 -141047417 3 141680161 63044568 28774375 4268716378 141047417 141047417 63044568 4229654142 -141680161 4 145294611 141047417 28774375 4268716378 141680161 141680161 63044568 4229654142 -145294611 5 225513085 141680161 28774375 4268716378 145294611 145294611 63044568 4229654142 -225513085 6 243203849 145294611 28774375 4268716378 225513085 225513085 63044568 4229654142 -243203849 7 326151275 225513085 28774375 4268716378 243203849 243203849 63044568 4229654142 -326151275 8 431948861 243203849 28774375 4268716378 326151275 326151275 63044568 4229654142 -431948861 9 466439833 326151275 28774375 4268716378 431948861 431948861 63044568 4229654142 -466439833 10 473294098 431948861 28774375 4268716378 466439833 466439833 63044568 4229654142 -473294098 11 520189543 466439833 28774375 4268716378 473294098 473294098 63044568 4229654142 -520189543 12 538589788 473294098 28774375 4268716378 520189543 520189543 63044568 4229654142 -538589788 13 557517119 520189543 28774375 4268716378 538589788 538589788 63044568 4229654142 -557517119 14 559847112 538589788 28774375 4268716378 557517119 557517119 63044568 4229654142 -559847112 15 598822671 557517119 28774375 4268716378 559847112 559847112 63044568 4229654142 -598822671 16 662099130 559847112 28774375 4268716378 598822671 598822671 63044568 4229654142 -662099130 17 754775609 598822671 28774375 4268716378 662099130 662099130 63044568 4229654142 -754775609 18 774637006 662099130 28774375 4268716378 754775609 754775609 63044568 4229654142 -774637006 19 811650497 754775609 28774375 4268716378 774637006 774637006 63044568 4229654142 -811650497 20 879082834 774637006 28774375 4268716378 811650497 811650497 63044568 4229654142 -879082834 21 933879086 811650497 28774375 4268716378 879082834 879082834 63044568 4229654142 -933879086 22 974297360 879082834 28774375 4268716378 933879086 933879086 63044568 4229654142 -974297360 23 1000948272 933879086 28774375 4268716378 974297360 974297360 63044568 4229654142 -1000948272 24 1013876852 974297360 28774375 4268716378 1000948272 1000948272 63044568 4229654142 -1013876852 25 1088543984 1000948272 28774375 4268716378 1013876852 1013876852 63044568 4229654142 -1088543984 26 1098639440 1013876852 28774375 4268716378 1088543984 1088543984 63044568 4229654142 -1098639440 27 1157161427 1088543984 28774375 4268716378 1098639440 1098639440 63044568 4229654142 -1157161427 28 1229567292 1098639440 28774375 4268716378 1157161427 1157161427 63044568 4229654142 -1229567292 29 1243785310 1157161427 28774375 4268716378 1229567292 1229567292 63044568 4229654142 -1243785310 30 1289293657 1229567292 28774375 4268716378 1243785310 1243785310 63044568 4229654142 -1289293657 31 1362369177 1243785310 28774375 4268716378 1289293657 1289293657 63044568 4229654142 -1362369177 32 1365198901 1289293657 28774375 4268716378 1362369177 1362369177 63044568 4229654142 -1365198901 33 1454057357 1362369177 28774375 4268716378 1365198901 1365198901 63044568 4229654142 -1454057357 34 1491205016 1365198901 28774375 4268716378 1454057357 1454057357 63044568 4229654142 -1491205016 35 1534194097 1454057357 28774375 4268716378 1491205016 1491205016 63044568 4229654142 -1534194097 36 1538863055 1491205016 28774375 4268716378 1534194097 1534194097 63044568 4229654142 -1538863055 37 1787652631 1534194097 28774375 4268716378 1538863055 1538863055 63044568 4229654142 -1787652631 38 1824517658 1538863055 28774375 4268716378 1787652631 1787652631 63044568 4229654142 -1824517658 39 1842680163 1787652631 28774375 4268716378 1824517658 1824517658 63044568 4229654142 -1842680163 40 1865307672 1824517658 28774375 4268716378 1842680163 1842680163 63044568 4229654142 -1865307672 41 1995343206 1842680163 28774375 4268716378 1865307672 1865307672 63044568 4229654142 -1995343206 42 2013662838 1865307672 28774375 4268716378 1995343206 1995343206 63044568 4229654142 -2013662838 43 2042457019 1995343206 28774375 4268716378 2013662838 2013662838 63044568 4229654142 -2042457019 44 2093538928 2013662838 28774375 4268716378 2042457019 2042457019 63044568 4229654142 -2093538928 45 2125812933 2042457019 28774375 4268716378 2093538928 2093538928 63044568 4229654142 -2125812933 46 2214035726 2093538928 28774375 4268716378 2125812933 2125812933 63044568 4229654142 -2214035726 47 2293105904 2125812933 28774375 4268716378 2214035726 2214035726 63044568 4229654142 -2293105904 48 2306130875 2214035726 28774375 4268716378 2293105904 2293105904 63044568 4229654142 -2306130875 49 2307004493 2293105904 28774375 4268716378 2306130875 2306130875 63044568 4229654142 -2307004493 50 2424630722 2306130875 28774375 4268716378 2307004493 2307004493 63044568 4229654142 -2424630722 51 2496054700 2307004493 28774375 4268716378 2424630722 2424630722 63044568 4229654142 -2496054700 52 2502326480 2424630722 28774375 4268716378 2496054700 2496054700 63044568 4229654142 -2502326480 53 2525744318 2496054700 28774375 4268716378 2502326480 2502326480 63044568 4229654142 -2525744318 54 2592330556 2502326480 28774375 4268716378 2525744318 2525744318 63044568 4229654142 -2592330556 55 2610290479 2525744318 28774375 4268716378 2592330556 2592330556 63044568 4229654142 -2610290479 56 2669374863 2592330556 28774375 4268716378 2610290479 2610290479 63044568 4229654142 -2669374863 57 2705709344 2610290479 28774375 4268716378 2669374863 2669374863 63044568 4229654142 -2705709344 58 2712615025 2669374863 28774375 4268716378 2705709344 2705709344 63044568 4229654142 -2712615025 59 2778168728 2705709344 28774375 4268716378 2712615025 2712615025 63044568 4229654142 -2778168728 60 2818832252 2712615025 28774375 4268716378 2778168728 2778168728 63044568 4229654142 -2818832252 61 2830981072 2778168728 28774375 4268716378 2818832252 2818832252 63044568 4229654142 -2830981072 62 2844041986 2818832252 28774375 4268716378 2830981072 2830981072 63044568 4229654142 -2844041986 63 2861376515 2830981072 28774375 4268716378 2844041986 2844041986 63044568 4229654142 -2861376515 64 2861911482 2844041986 28774375 4268716378 2861376515 2861376515 63044568 4229654142 -2861911482 65 2939920218 2861376515 28774375 4268716378 2861911482 2861911482 63044568 4229654142 -2939920218 66 3023531799 2861911482 28774375 4268716378 2939920218 2939920218 63044568 4229654142 -3023531799 67 3105312559 2939920218 28774375 4268716378 3023531799 3023531799 63044568 4229654142 -3105312559 68 3126475872 3023531799 28774375 4268716378 3105312559 3105312559 63044568 4229654142 -3126475872 69 3188005828 3105312559 28774375 4268716378 3126475872 3126475872 63044568 4229654142 -3188005828 70 3198969145 3126475872 28774375 4268716378 3188005828 3188005828 63044568 4229654142 -3198969145 71 3275293996 3188005828 28774375 4268716378 3198969145 3198969145 63044568 4229654142 -3275293996 72 3276123488 3198969145 28774375 4268716378 3275293996 3275293996 63044568 4229654142 -3276123488 73 3314983189 3275293996 28774375 4268716378 3276123488 3276123488 63044568 4229654142 -3314983189 74 3342719438 3276123488 28774375 4268716378 3314983189 3314983189 63044568 4229654142 -3342719438 75 3373581039 3314983189 28774375 4268716378 3342719438 3342719438 63044568 4229654142 -3373581039 76 3398507249 3342719438 28774375 4268716378 3373581039 3373581039 63044568 4229654142 -3398507249 77 3455216719 3373581039 28774375 4268716378 3398507249 3398507249 63044568 4229654142 -3455216719 78 3457053821 3398507249 28774375 4268716378 3455216719 3455216719 63044568 4229654142 -3457053821 79 3473924576 3455216719 28774375 4268716378 3457053821 3457053821 63044568 4229654142 -3473924576 80 3521368277 3457053821 28774375 4268716378 3473924576 3473924576 63044568 4229654142 -3521368277 81 3542840110 3473924576 28774375 4268716378 3521368277 3521368277 63044568 4229654142 -3542840110 82 3566741189 3521368277 28774375 4268716378 3542840110 3542840110 63044568 4229654142 -3566741189 83 3570297463 3542840110 28774375 4268716378 3566741189 3566741189 63044568 4229654142 -3570297463 84 3577318119 3566741189 28774375 4268716378 3570297463 3570297463 63044568 4229654142 -3577318119 85 3593959807 3570297463 28774375 4268716378 3577318119 3577318119 63044568 4229654142 -3593959807 86 3625286410 3577318119 28774375 4268716378 3593959807 3593959807 63044568 4229654142 -3625286410 87 3717551163 3593959807 28774375 4268716378 3625286410 3625286410 63044568 4229654142 -3717551163 88 3759340273 3625286410 28774375 4268716378 3717551163 3717551163 63044568 4229654142 -3759340273 89 3766999078 3717551163 28774375 4268716378 3759340273 3759340273 63044568 4229654142 -3766999078 90 3862393166 3759340273 28774375 4268716378 3766999078 3766999078 63044568 4229654142 -3862393166 91 3959216334 3766999078 28774375 4268716378 3862393166 3862393166 63044568 4229654142 -3959216334 92 3998790955 3862393166 28774375 4268716378 3959216334 3959216334 63044568 4229654142 -3998790955 93 4015442341 3959216334 28774375 4268716378 3998790955 3998790955 63044568 4229654142 -4015442341 94 4061635107 3998790955 28774375 4268716378 4015442341 4015442341 63044568 4229654142 -4061635107 95 4076864659 4015442341 28774375 4268716378 4061635107 4061635107 63044568 4229654142 -4076864659 96 4144173353 4061635107 28774375 4268716378 4076864659 4076864659 63044568 4229654142 -4144173353 97 4216440507 4076864659 28774375 4268716378 4144173353 4144173353 63044568 4229654142 -4216440507 98 4229654142 4144173353 28774375 4268716378 4216440507 4216440507 63044568 4229654142 -4229654142 99 4268716378 4216440507 28774375 4268716378 4229654142 4229654142 63044568 4229654142 -4268716378 100 NULL 4229654142 28774375 4268716378 4268716378 4268716378 63044568 NULL query IIRIIIIII @@ -315,106 +115,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY row_number; ---- -1 100 7.81 781 125 -117 0 -1 -61 -2 100 7.81 781 125 -117 0 -1 -61 -3 100 7.81 781 125 -117 0 -1 -61 -4 100 7.81 781 125 -117 0 -1 -61 -5 100 7.81 781 125 -117 0 -1 -61 -6 100 7.81 781 125 -117 0 -1 -61 -7 100 7.81 781 125 -117 0 -1 -61 -8 100 7.81 781 125 -117 0 -1 -61 -9 100 7.81 781 125 -117 0 -1 -61 -10 100 7.81 781 125 -117 0 -1 -61 -11 100 7.81 781 125 -117 0 -1 -61 -12 100 7.81 781 125 -117 0 -1 -61 -13 100 7.81 781 125 -117 0 -1 -61 -14 100 7.81 781 125 -117 0 -1 -61 -15 100 7.81 781 125 -117 0 -1 -61 -16 100 7.81 781 125 -117 0 -1 -61 -17 100 7.81 781 125 -117 0 -1 -61 -18 100 7.81 781 125 -117 0 -1 -61 -19 100 7.81 781 125 -117 0 -1 -61 -20 100 7.81 781 125 -117 0 -1 -61 -21 100 7.81 781 125 -117 0 -1 -61 -22 100 7.81 781 125 -117 0 -1 -61 -23 100 7.81 781 125 -117 0 -1 -61 -24 100 7.81 781 125 -117 0 -1 -61 -25 100 7.81 781 125 -117 0 -1 -61 -26 100 7.81 781 125 -117 0 -1 -61 -27 100 7.81 781 125 -117 0 -1 -61 -28 100 7.81 781 125 -117 0 -1 -61 -29 100 7.81 781 125 -117 0 -1 -61 -30 100 7.81 781 125 -117 0 -1 -61 -31 100 7.81 781 125 -117 0 -1 -61 -32 100 7.81 781 125 -117 0 -1 -61 -33 100 7.81 781 125 -117 0 -1 -61 -34 100 7.81 781 125 -117 0 -1 -61 -35 100 7.81 781 125 -117 0 -1 -61 -36 100 7.81 781 125 -117 0 -1 -61 -37 100 7.81 781 125 -117 0 -1 -61 -38 100 7.81 781 125 -117 0 -1 -61 -39 100 7.81 781 125 -117 0 -1 -61 -40 100 7.81 781 125 -117 0 -1 -61 -41 100 7.81 781 125 -117 0 -1 -61 -42 100 7.81 781 125 -117 0 -1 -61 -43 100 7.81 781 125 -117 0 -1 -61 -44 100 7.81 781 125 -117 0 -1 -61 -45 100 7.81 781 125 -117 0 -1 -61 -46 100 7.81 781 125 -117 0 -1 -61 -47 100 7.81 781 125 -117 0 -1 -61 -48 100 7.81 781 125 -117 0 -1 -61 -49 100 7.81 781 125 -117 0 -1 -61 -50 100 7.81 781 125 -117 0 -1 -61 -51 100 7.81 781 125 -117 0 -1 -61 -52 100 7.81 781 125 -117 0 -1 -61 -53 100 7.81 781 125 -117 0 -1 -61 -54 100 7.81 781 125 -117 0 -1 -61 -55 100 7.81 781 125 -117 0 -1 -61 -56 100 7.81 781 125 -117 0 -1 -61 -57 100 7.81 781 125 -117 0 -1 -61 -58 100 7.81 781 125 -117 0 -1 -61 -59 100 7.81 781 125 -117 0 -1 -61 -60 100 7.81 781 125 -117 0 -1 -61 -61 100 7.81 781 125 -117 0 -1 -61 -62 100 7.81 781 125 -117 0 -1 -61 -63 100 7.81 781 125 -117 0 -1 -61 -64 100 7.81 781 125 -117 0 -1 -61 -65 100 7.81 781 125 -117 0 -1 -61 -66 100 7.81 781 125 -117 0 -1 -61 -67 100 7.81 781 125 -117 0 -1 -61 -68 100 7.81 781 125 -117 0 -1 -61 -69 100 7.81 781 125 -117 0 -1 -61 -70 100 7.81 781 125 -117 0 -1 -61 -71 100 7.81 781 125 -117 0 -1 -61 -72 100 7.81 781 125 -117 0 -1 -61 -73 100 7.81 781 125 -117 0 -1 -61 -74 100 7.81 781 125 -117 0 -1 -61 -75 100 7.81 781 125 -117 0 -1 -61 -76 100 7.81 781 125 -117 0 -1 -61 -77 100 7.81 781 125 -117 0 -1 -61 -78 100 7.81 781 125 -117 0 -1 -61 -79 100 7.81 781 125 -117 0 -1 -61 -80 100 7.81 781 125 -117 0 -1 -61 -81 100 7.81 781 125 -117 0 -1 -61 -82 100 7.81 781 125 -117 0 -1 -61 -83 100 7.81 781 125 -117 0 -1 -61 -84 100 7.81 781 125 -117 0 -1 -61 -85 100 7.81 781 125 -117 0 -1 -61 -86 100 7.81 781 125 -117 0 -1 -61 -87 100 7.81 781 125 -117 0 -1 -61 -88 100 7.81 781 125 -117 0 -1 -61 -89 100 7.81 781 125 -117 0 -1 -61 -90 100 7.81 781 125 -117 0 -1 -61 -91 100 7.81 781 125 -117 0 -1 -61 -92 100 7.81 781 125 -117 0 -1 -61 -93 100 7.81 781 125 -117 0 -1 -61 -94 100 7.81 781 125 -117 0 -1 -61 -95 100 7.81 781 125 -117 0 -1 -61 -96 100 7.81 781 125 -117 0 -1 -61 -97 100 7.81 781 125 -117 0 -1 -61 -98 100 7.81 781 125 -117 0 -1 -61 -99 100 7.81 781 125 -117 0 -1 -61 -100 100 7.81 781 125 -117 0 -1 -61 query IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII SELECT @@ -473,106 +173,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- --35127 -20071 1171968280 -44741 -60 -1045189740 1645376618 15862627961 728662 61035129 2252131671 4277743253 2191096542 -16110 NULL NULL NULL NULL 61035129 61035129 61035129 -16110 61035129 61035129 61035129 NULL 22943 14370 41423756 51422 -76 152325502 813503800 15862627961 145307 61035129 65801428664 65851295281 65740393535 -37724 -22668 623103518 3056 -94 311073214 -1380600149 15862627961 -512775 61035129 13671531419 11863321054 13610496290 -37269 20967 1213926989 -54145 -59 -1574720463 1639694101 15862627961 951392 -108973366 5255341318 5017916272 5364314684 3917 NULL NULL NULL NULL -108973366 -108973366 -108973366 3917 -108973366 -108973366 -108973366 NULL 36569 15411 -168758331 30244 -111 -411945604 -21912375 15862627961 131173 -108973366 65779516289 65645302382 65888489655 -31020 -47322 1436496767 40175 -79 1208315423 -1743478794 15862627961 -715478 -108973366 10498313277 8380366394 10607286643 -14062 11006 61035129 -15056 -48 -1285298976 1303653581 15862627961 695376 623103518 3999306907 2191096542 3376203389 -16974 NULL NULL NULL NULL 623103518 623103518 623103518 -16974 623103518 623103518 623103518 NULL -80790 -20401 439738328 -23739 3 1649686324 2655635766 15862627961 137382 623103518 61887961550 62474806028 61264858032 -35127 -38183 994303988 29390 -60 -1045189740 -3184474087 15862627961 -480353 623103518 12486424572 12926162900 11863321054 -1164 19243 -2117946883 -15742 55 89808975 -2114836321 15862627961 952517 -1927628110 6045764800 7482261567 7973392910 -1114 NULL NULL NULL NULL -1927628110 -1927628110 -1927628110 -1114 -1927628110 -1927628110 -1927628110 NULL 6563 15786 -2098805236 -18678 -60 -6017567290 -7620706510 15862627961 19981 -1927628110 28492735496 26501601552 30420363606 -30917 -12838 -4229382 5182 71 -2943527053 -1901324969 15862627961 -721634 -1927628110 7889235051 9791258889 9816863161 -67523 35827 49866617 -24738 -25 -3496662635 -3184474087 15862627961 740879 -1899175111 7846553398 7217066918 9745728509 15673 NULL NULL NULL NULL -1899175111 -1899175111 -1899175111 15673 -1899175111 -1899175111 -1899175111 NULL -6162 12516 -1927628110 -65159 74 -5735284114 -7480826912 15862627961 13915 -1899175111 32328844499 30420363606 34228019610 11625 -20071 -1302295658 56517 -44 -2878810989 -3871666709 15862627961 -493209 -1899175111 6116899452 6500252161 8016074563 -14039 -18815 2064155045 -9562 -95 2065442845 -1901324969 15862627961 826881 -1991133944 10028823751 7930018515 12019957695 13630 NULL NULL NULL NULL -1991133944 -1991133944 -1991133944 13630 -1991133944 -1991133944 -1991133944 NULL 49758 23501 -2117946883 -7180 -106 -6207886063 -7726418058 15862627961 21095 -1991133944 26501601552 24402796316 28492735496 17679 -15175 370975815 -5204 22 26303141 3645319585 15862627961 -581254 -1991133944 3842670266 5873635473 5833804210 -17679 27241 586844478 -5985 83 26303141 -2140016957 15862627961 790510 -346989627 7246194997 9293832357 7593184624 -13217 NULL NULL NULL NULL -346989627 -346989627 -346989627 -13217 -346989627 -346989627 -346989627 NULL 21293 25691 -421042466 33795 38 -1150515104 -1088583413 15862627961 74253 -346989627 64556718969 64174235958 64903708596 -14433 -4871 1171968280 32854 97 -2135787575 2057268348 15862627961 -571730 -346989627 8269443337 10412916428 8616432964 -53780 -7078 -2138770630 29390 -117 -1972491598 -3888467183 15862627961 567403 -1009656194 12359612306 13122545262 13369268500 20690 NULL NULL NULL NULL -1009656194 -1009656194 -1009656194 20690 -1009656194 -1009656194 -1009656194 NULL 13030 16725 -1090239422 -4859 36 -3111565177 -3684432366 15862627961 20225 -1009656194 55728616981 54716947420 56738273175 74575 13717 -134213907 17417 -38 -3553056774 -559380590 15862627961 -314716 -1009656194 2493359461 4544584183 3503015655 -28098 -8332 -903316089 44641 70 -367071380 1863474126 15862627961 211266 397430452 18400914040 17257111702 18003483588 28162 NULL NULL NULL NULL 397430452 397430452 397430452 28162 397430452 397430452 397430452 NULL 55734 42613 370975815 -54898 96 1151758976 1690027799 15862627961 240186 397430452 64604572155 64987924864 64207141703 36394 -36 -1383162419 -44741 57 1160862510 1981771941 15862627961 48893 397430452 -2140855627 -814987309 -2538286079 -17679 27241 794623392 -5985 120 26303141 -2140016957 15862627961 890461 1993193190 7523673648 8823393281 5530480458 11640 NULL NULL NULL NULL 1993193190 1993193190 1993193190 11640 1993193190 1993193190 1993193190 NULL -5373 23425 1955646088 15840 -94 5940012252 8082771141 15862627961 214888 1993193190 20549346056 22540519030 18556152866 -14433 -4871 -168758331 32854 13 -2135787575 2057268348 15862627961 -646824 1993193190 10332147503 9000614313 8338954313 -15239 -44678 -1143802338 -17538 -8 2322760594 2439184170 15862627961 239018 1325868318 18003483588 18400914040 16677615270 27752 NULL NULL NULL NULL 1325868318 1325868318 1325868318 27752 1325868318 1325868318 1325868318 NULL 681 -16888 1282464673 -45061 17 3908052624 5430561808 15862627961 278980 1325868318 46149116149 47448835782 44823247831 4929 -54988 1188089983 -49963 14 750085326 437338198 15862627961 20731 1325868318 -814987309 -2198149728 -2140855627 -46712 64670 1282464673 27693 102 -1775723035 -1449239099 15862627961 487280 -1882293856 2457410212 3794453361 4339704068 -24085 NULL NULL NULL NULL -1882293856 -1882293856 -1882293856 -24085 -1882293856 -1882293856 -1882293856 NULL -71225 -6066 -1899175111 -47662 65 -5666891363 -7164866243 15862627961 -22782 -1882293856 36113442006 34228019610 37995735862 -5560 12398 1738331255 55502 17 -2036083577 974546445 15862627961 -279368 -1882293856 11522923893 13514096867 13405217749 --49576 387 -1908480893 59917 17 -2287736392 3560913151 15862627961 534161 1282464673 5076918034 5508296712 3794453361 -22501 NULL NULL NULL NULL 1282464673 1282464673 1282464673 -22501 1282464673 1282464673 1282464673 NULL 42891 47166 1188285940 17569 13 3684677602 5245095773 15862627961 238615 1282464673 48731300455 49945227444 47448835782 15239 65202 -1882293856 -12225 103 2322760594 -144263301 15862627961 -324665 1282464673 12068174600 13405217749 10785709927 --2090 -4237 427197269 -13608 NULL 6149069904 -2420213359 15862627961 231997 1544188174 1544188174 2203610908 NULL -31500 NULL NULL NULL NULL 1544188174 1544188174 1544188174 -31500 1544188174 1544188174 1544188174 NULL -18123 25480 1436496767 -11294 -90 4470418181 6406964162 15862627961 218731 1544188174 36368366538 37858099778 34824178364 -38792 -40939 NULL -6613 3 -759786886 6588808232 15862627961 -31500 1544188174 15862627961 15862627961 14318439787 -40940 29579 -2098805236 5182 -43 5636453529 2057268348 15862627961 840492 2030965207 12019957695 10028823751 9988992488 13611 NULL NULL NULL NULL 2030965207 2030965207 2030965207 13611 2030965207 2030965207 2030965207 NULL 2922 -12918 1993193190 24244 1 6049769979 8162828451 15862627961 212619 2030965207 16530541284 18556152866 14499576077 2913 -8448 794623392 13699 -98 1253758252 5168794507 15862627961 -594884 2030965207 5873635473 6244611288 3842670266 --5560 -33253 -1383162419 30451 -59 -2036083577 1519076272 15862627961 317051 -537142430 16872687706 18060777689 17409830136 25305 NULL NULL NULL NULL -537142430 -537142430 -537142430 25305 -537142430 -537142430 -537142430 NULL 93435 11121 -629486480 16126 -86 -1754460240 -1808326929 15862627961 71344 -537142430 62748392040 62160560710 63285534470 71051 43358 1955646088 -17958 -72 812635004 -546350337 15862627961 -59749 -537142430 -1547202175 -123244379 -1010059745 -31670 65202 1991172974 66574 17 1113315852 -1552050368 15862627961 411060 1689098844 610199839 2348531094 -1078899005 -26526 NULL NULL NULL NULL 1689098844 1689098844 1689098844 -26526 1689098844 1689098844 1689098844 NULL -67930 -34435 1579876740 -4527 104 4862775988 7154336102 15862627961 207437 1689098844 31650501220 33244301624 29961402376 11586 45118 -1813935549 36740 104 -408248030 2439184170 15862627961 -205589 1689098844 16941526966 16268289323 15252428122 --32689 -38183 431378678 80491 -24 1584341489 2495165914 15862627961 511365 1337043149 3794453361 5076918034 2457410212 -22796 NULL NULL NULL NULL 1337043149 1337043149 1337043149 -22796 1337043149 1337043149 1337043149 NULL -8787 -9888 1299719633 3021 29 3962631100 5528651286 15862627961 256184 1337043149 44823247831 46149116149 43486204682 57823 52329 1991172974 -24442 73 3944161437 1645376618 15862627961 -302164 1337043149 13405217749 11522923893 12068174600 -53530 14090 -346989627 13699 -94 2759425399 4309797580 15862627961 760652 1171968280 5449711533 7593184624 4277743253 -15154 NULL NULL NULL NULL 1171968280 1171968280 1171968280 -15154 1171968280 1171968280 1171968280 NULL 40902 48684 912707948 52779 -72 3078980216 4762271192 15862627961 208337 1171968280 53493571647 54487875635 52321603367 20625 -18815 61035129 36170 83 2284185998 2900644355 15862627961 -543809 1171968280 11584884708 13610496290 10412916428 -46693 37793 1436496767 17417 -111 799645256 2352299442 15862627961 951046 1902023838 7973392910 6045764800 6071369072 -1471 NULL NULL NULL NULL 1902023838 1902023838 1902023838 -1471 1902023838 1902023838 1902023838 NULL -6157 -51662 1738331255 11978 -5 5465237258 7842036090 15862627961 202910 1902023838 26398188956 28223071121 24496165118 44727 35827 434021400 66574 -106 2940130772 -1339125374 15862627961 -720520 1902023838 9791258889 9787029507 7889235051 -38577 -5070 240273900 -8549 14 -3241149212 1796328434 15862627961 183104 -1143802338 17257111702 16353795613 18400914040 28781 NULL NULL NULL NULL -1143802338 -1143802338 -1143802338 28781 -1143802338 -1143802338 -1143802338 NULL 32735 -15096 -1222533990 5730 52 -3542826806 -4255367515 15862627961 14495 -1143802338 52482905660 51306415182 53626707998 36569 -7078 1325868318 11267 97 2171332508 -1552050368 15862627961 77674 -1143802338 -2538286079 -2140855627 -1394483741 --32689 -38183 1738331255 80491 65 1584341489 2495165914 15862627961 382990 -673237643 -1078899005 610199839 -405661362 -28070 NULL NULL NULL NULL -673237643 -673237643 -673237643 -28070 -673237643 -673237643 -673237643 NULL 7012 16622 -842693467 35616 41 -2316492881 -2534780922 15862627961 10423 -673237643 60213611118 59413049347 60886848761 57823 52329 -1222533990 -24442 64 3944161437 1645376618 15862627961 -179063 -673237643 16268289323 14454353774 16941526966 --611 -37351 706441268 -33532 63 2660931489 -1025454778 15862627961 504513 1188285940 12172060572 13996942737 10983774632 21576 NULL NULL NULL NULL 1188285940 1188285940 1188285940 21576 1188285940 1188285940 1188285940 NULL 19407 -33372 1171968280 -4275 -99 3548344203 4984397235 15862627961 255503 1188285940 51133513384 52321603367 49945227444 31670 -5070 762932956 -9599 -82 1113315852 3560913151 15862627961 -250940 1188285940 4878853329 2740082699 3690567389 --48148 9534 -842693467 -12225 -31 5218698356 1009134449 15862627961 829815 2053379412 11934056247 10048633851 9880676835 -12642 NULL NULL NULL NULL 2053379412 2053379412 2053379412 -12642 2053379412 2053379412 2053379412 NULL 25390 4928 2047637360 7776 -53 6152241494 8367712833 15862627961 224221 2053379412 8367712833 10418937555 6314333421 -55203 2479 2047637360 -20802 74 2894556845 7209871330 15862627961 -610460 2053379412 5981951126 6568795604 3928571714 -24352 -8790 -1885422396 56438 97 433054757 2427194517 15862627961 816908 586844478 9880676835 11934056247 9293832357 -12907 NULL NULL NULL NULL 586844478 586844478 586844478 -12907 586844478 586844478 586844478 NULL -72468 -24562 434021400 -33025 36 1460604206 2539868628 15862627961 154356 586844478 62474806028 62914544356 61887961550 68836 35694 -346989627 16515 93 2056218702 -1449239099 15862627961 -597818 586844478 6568795604 8616432964 5981951126 --49576 387 702611616 59917 -72 -2287736392 3560913151 15862627961 890731 -382483011 5591766247 7081499487 5974249258 -9565 NULL NULL NULL NULL -382483011 -382483011 -382483011 -9565 -382483011 -382483011 -382483011 NULL 28214 57819 -467659022 10448 -101 -1271184499 -1302308093 15862627961 87470 -382483011 64174235958 63753193492 64556718969 15239 65202 -1090239422 -12225 -12 2322760594 -144263301 15862627961 -668299 -382483011 9888378703 7746926999 10270861714 --17721 13717 -587831330 -24442 -40 -1441635278 -489488557 15862627961 438243 -800561771 13902822234 14618057582 14703384005 23127 NULL NULL NULL NULL -800561771 -800561771 -800561771 23127 -800561771 -800561771 -800561771 NULL -9802 7625 -903316089 -16949 17 -2546571327 -2747511363 15862627961 38493 -800561771 59413049347 58570355880 60213611118 -39770 -8332 1824882165 -24738 52 1609316679 -2085860747 15862627961 -183119 -800561771 1159243956 1865685224 1959805727 --14433 -8448 434021400 -12838 -90 -2135787575 -187208211 15862627961 940911 -1011669561 7302003527 5641577054 8313673088 -2904 NULL NULL NULL NULL -1011669561 -1011669561 -1011669561 -2904 -1011669561 -1011669561 -1011669561 NULL 65617 59887 -1143802338 28315 47 -3245711321 -3853408460 15862627961 -465 -1011669561 54716947420 53626707998 55728616981 -16856 -10871 1354539333 -9562 -61 -187208211 -921860586 15862627961 -711818 -1011669561 7548954873 9128831613 8560624434 -90245 56283 -1009656194 -28042 38 -1634505428 1074101516 15862627961 605927 -134213907 11318043778 13369268500 11452257685 19208 NULL NULL NULL NULL -134213907 -134213907 -134213907 19208 -134213907 -134213907 -134213907 NULL 56920 23665 -237425046 18287 113 -540397284 -205992899 15862627961 127256 -134213907 65645302382 65476544051 65779516289 2003 -31959 1593800404 67120 -117 -664229739 -541722291 15862627961 -354722 -134213907 4410370276 4074959867 4544584183 --30917 -15175 -1927628110 -10871 -54 -2943527053 824461350 15862627961 949079 -4229382 6071369072 7973392910 6075598454 -1967 NULL NULL NULL NULL -4229382 -4229382 -4229382 -1967 -4229382 -4229382 -4229382 NULL 47625 29338 -134213907 16101 62 -247416655 148096120 15862627961 129206 -4229382 65888489655 65779516289 65892719037 -15742 NULL -1660426473 -18079 55 824461350 -2140016957 15862627961 -719049 -4229382 9787029507 10221050907 9791258889 -36636 -19881 1423957796 31696 52 450275604 -4140888104 15862627961 391728 -587831330 14030226252 15985872340 14618057582 24495 NULL NULL NULL NULL -587831330 -587831330 -587831330 24495 -587831330 -587831330 -587831330 NULL 32851 -32737 -644225469 50996 -29 -1861543279 -2013675248 15862627961 46039 -587831330 62160560710 61531074230 62748392040 67523 11006 -800561771 -8549 -5 -3496662635 2352299442 15862627961 -135236 -587831330 1244570379 1959805727 1832401709 --37724 7017 670497898 36430 -98 311073214 1845356201 15862627961 813251 -2098805236 7930018515 9994173560 10028823751 13741 NULL NULL NULL NULL -2098805236 -2098805236 -2098805236 13741 -2098805236 -2098805236 -2098805236 NULL 39750 10334 -2138770630 -9223 -98 -6355522749 -7926048183 15862627961 7465 -2098805236 24402796316 22284849433 26501601552 28098 72839 2030965207 -15056 -53 -367071380 -489488557 15862627961 -567513 -2098805236 5833804210 3842670266 7932609446 --22116 11412 -237425046 -26471 71 3390925772 -7024468539 15862627961 953437 -2117946883 5364314684 5255341318 7482261567 2045 NULL NULL NULL NULL -2117946883 -2117946883 -2117946883 2045 -2117946883 -2117946883 -2117946883 NULL 7465 -29777 -2141451704 26257 22 -6398169217 -8135514173 15862627961 -6276 -2117946883 22284849433 20146078803 24402796316 -21948 11580 -1927628110 -11396 113 -6071106818 5455080817 15862627961 -719395 -2117946883 8380366394 9816863161 10498313277 --2090 -4237 -168758331 -13608 12 6149069904 -2420213359 15862627961 928929 2106705285 6889553023 7030771979 4782847738 8692 NULL NULL NULL NULL 2106705285 2106705285 2106705285 8692 2106705285 2106705285 2106705285 NULL 14450 6674 2053379412 -14704 83 6224239742 4250178376 15862627961 246701 2106705285 4250178376 6314333421 2143473091 -38792 -40939 1213926989 -6613 -76 -759786886 6588808232 15862627961 -688240 2106705285 11079780223 9630784700 8973074938 --31090 -36 -335410409 46015 123 3395035512 1258109085 15862627961 660587 2033001162 10193867690 11787668094 8160866528 18109 NULL NULL NULL NULL 2033001162 2033001162 2033001162 18109 2033001162 2033001162 2033001162 NULL 14299 -4240 2025611582 -6507 97 6089577951 8185242656 15862627961 230728 2033001162 14499576077 16530541284 12466574915 33616 64670 41423756 -30544 97 2641271504 1946039989 15862627961 -410481 2033001162 7701761433 8554270670 5668760271 --44611 -31959 1337043149 -8886 104 4160882907 7209871330 15862627961 462722 1991172974 4339704068 2457410212 2348531094 -24558 NULL NULL NULL NULL 1991172974 1991172974 1991172974 -24558 1991172974 1991172974 1991172974 NULL 32587 20609 1902023838 9371 -101 5848842900 8040942953 15862627961 203248 1991172974 22540519030 24496165118 20549346056 -55630 -42978 1689098844 -54145 -24 5156491918 3739840441 15862627961 -255283 1991172974 13514096867 15252428122 11522923893 --32689 -38183 383352709 80491 -53 1584341489 2495165914 15862627961 785722 670497898 10664671458 9362375800 9994173560 14457 NULL NULL NULL NULL 670497898 670497898 670497898 14457 670497898 670497898 670497898 NULL -53620 -29881 623103518 38314 5 1953024150 2794786130 15862627961 121331 670497898 60605435298 61264858032 59934937400 57823 52329 -2098805236 -24442 77 3944161437 1645376618 15862627961 -539268 670497898 5868454401 7932609446 5197956503 -71051 40600 1188285940 51482 47 812635004 1210863559 15862627961 546713 762932956 13122545262 10983774632 12359612306 20744 NULL NULL NULL NULL 762932956 762932956 762932956 20744 762932956 762932956 762932956 NULL 71694 14926 706441268 61320 -5 2184609572 3322773533 15862627961 180389 762932956 57810649168 58525884516 57047716212 59319 28868 2051224722 27693 63 1840350039 1195987713 15862627961 -293972 762932956 3503015655 2493359461 2740082699 --12381 -40939 -1331533190 12207 -56 -2472569238 2900644355 15862627961 920237 141218956 7030771979 6862013648 6889553023 8809 NULL NULL NULL NULL 141218956 141218956 141218956 8809 141218956 141218956 141218956 NULL 54443 32211 49866617 57908 123 252120702 1135821380 15862627961 154116 141218956 65740393535 65801428664 65599174579 35484 6926 -1448995523 -26471 122 1728676075 -6189260496 15862627961 -679431 141218956 8973074938 11079780223 8831855982 -36569 45118 439738328 56517 -2 2171332508 -559380590 15862627961 640723 1413111008 1942161073 2936465061 529050065 -18410 NULL NULL NULL NULL 1413111008 1413111008 1413111008 -18410 1413111008 1413111008 1413111008 NULL 7977 4956 1337043149 16312 -59 4104693490 5763298811 15862627961 233919 1413111008 42131665349 43486204682 40718554341 36636 45185 -928766616 43647 29 450275604 2212756264 15862627961 -427136 1413111008 15333577896 13191578758 13920466888 -4929 22467 1689098844 11267 -117 750085326 -2222183579 15862627961 354528 -1813935549 -405661362 -1078899005 1408274187 -28462 NULL NULL NULL NULL -1813935549 -1813935549 -1813935549 -28462 -1813935549 -1813935549 -1813935549 NULL -65798 3061 -1885422396 -11548 -60 -5581651801 -6731567910 15862627961 -51244 -1813935549 37995735862 36113442006 39809671411 20255 37793 427197269 59917 17 -2263607335 846995940 15862627961 -150993 -1813935549 14454353774 13231819784 16268289323 -9669 -10720 1489733240 36170 52 -6330479452 775314354 15862627961 879609 -2141451704 5974249258 5591766247 8115700962 -11122 NULL NULL NULL NULL -2141451704 -2141451704 -2141451704 -11122 -2141451704 -2141451704 -2141451704 NULL -8321 NULL NULL 37242 63 -4283450842 -8496974453 15862627961 -29777 -2141451704 18004627099 15862627961 20146078803 47750 27361 -842693467 -13608 73 -1049567811 -7024468539 15862627961 -658734 -2141451704 7746926999 6656687577 9888378703 -44727 27310 -382483011 60858 -101 2940130772 -3871666709 15862627961 867553 -1090239422 8115700962 5974249258 9205940384 -12056 NULL NULL NULL NULL -1090239422 -1090239422 -1090239422 -12056 -1090239422 -1090239422 -1090239422 NULL 14740 919 -1176490478 -3695 -107 -3410532238 -4040331793 15862627961 2439 -1090239422 53626707998 52482905660 54716947420 53780 36363 -1885422396 8900 -72 -1972491598 1796328434 15862627961 -647612 -1090239422 6656687577 5813994110 7746926999 --68124 -47322 2053379412 -57682 -101 5160673327 7362171447 15862627961 803727 2047637360 9293832357 9880676835 7246194997 -13181 NULL NULL NULL NULL 2047637360 2047637360 2047637360 -13181 2047637360 2047637360 2047637360 NULL 21975 -2269 2030965207 20462 -117 6111603729 8216396539 15862627961 217547 2047637360 12466574915 14499576077 10418937555 -48148 -27346 2143473091 -71880 -31 5218698356 6899004582 15862627961 -584911 2047637360 8616432964 8269443337 6568795604 --55203 -42978 -1899175111 -49963 17 2894556845 -2190825778 15862627961 771265 -1302295658 9362375800 9745728509 10664671458 15091 NULL NULL NULL NULL -1302295658 -1302295658 -1302295658 15091 -1302295658 -1302295658 -1302295658 NULL 17400 21659 -1339586153 29700 -117 -3973415001 -4845122464 15862627961 -15205 -1302295658 48781585534 47450052344 50083881192 -49576 -37351 2064155045 -57682 -25 -2287736392 3321754114 15862627961 -524177 -1302295658 5197956503 5868454401 6500252161 -74575 45185 1579876740 3056 71 -3553056774 -2085860747 15862627961 929454 -644225469 5379257015 6733796348 6023482484 -4667 NULL NULL NULL NULL -644225469 -644225469 -644225469 -4667 -644225469 -644225469 -644225469 NULL -6306 10643 -800561771 65588 -44 -2118024883 -2398685709 15862627961 5756 -644225469 60886848761 60213611118 61531074230 14062 -15328 -421042466 60858 29 -1285298976 -4140888104 15862627961 -702124 -644225469 9839145477 8499559324 10483370946 -57823 -22668 NULL -30544 125 3944161437 2125466408 15862627961 64578 912707948 16330286983 15862627961 15417579035 32064 NULL NULL NULL NULL 912707948 912707948 912707948 32064 912707948 912707948 912707948 NULL 63846 33380 794623392 -7782 29 2559840577 4267070199 15862627961 241709 912707948 55400583583 56253092820 54487875635 42295 -38196 240273900 5494 -86 1466043674 1845356201 15862627961 199483 912707948 445048926 -731441552 -467659022 --16856 -4018 -673237643 NULL 96 -187208211 828690732 15862627961 324341 -1222533990 1408274187 -405661362 2630808177 -30187 NULL NULL NULL NULL -1222533990 -1222533990 -1222533990 -30187 -1222533990 -1222533990 -1222533990 NULL 21368 5358 -1331533190 47831 125 -3856362838 -4633066228 15862627961 -45392 -1222533990 50083881192 48781585534 51306415182 -12838 NULL 659422734 -5985 65 828690732 -2114836321 15862627961 -122531 -1222533990 13231819784 13659017053 14454353774 -32242 52329 -1222533990 36986 -56 -86961173 3300694238 15862627961 263497 659422734 2203610908 2630808177 1544188174 -30508 NULL NULL NULL NULL 659422734 659422734 659422734 -30508 659422734 659422734 659422734 NULL -63957 -30932 586844478 29383 17 1869370730 2738973516 15862627961 106874 659422734 61264858032 61887961550 60605435298 -1210 18877 NULL 44641 96 550424758 2125466408 15862627961 -62008 659422734 14318439787 15862627961 13659017053 -11586 -54988 2033001162 8900 68 -408248030 2212756264 15862627961 693544 41423756 7308357291 8160866528 7266933535 16337 NULL NULL NULL NULL 41423756 41423756 41423756 16337 41423756 41423756 41423756 NULL 53369 23125 -108973366 8573 68 -71778992 293544458 15862627961 145543 41423756 65892719037 65888489655 65851295281 46693 -19881 -629486480 -33532 123 799645256 -2222183579 15862627961 -445210 41423756 8595694426 8645561043 8554270670 -33616 -12399 -537142430 -6115 49 2641271504 974546445 15862627961 367233 1955646088 15985872340 17409830136 14030226252 24896 NULL NULL NULL NULL 1955646088 1955646088 1955646088 24896 1955646088 1955646088 1955646088 NULL -4189 -3056 1824882165 -28798 102 5682552091 7965623834 15862627961 227806 1955646088 24496165118 26398188956 22540519030 12762 -33253 715235348 -31054 -59 2856840301 3300694238 15862627961 -110340 1955646088 1832401709 1244570379 -123244379 -17679 27241 -2141451704 -5985 74 26303141 -2140016957 15862627961 855069 -842693467 9205940384 8115700962 10048633851 -12484 NULL NULL NULL NULL -842693467 -842693467 -842693467 -12484 -842693467 -842693467 -842693467 NULL 38958 -791 -928766616 -9610 31 -2674776172 -2960718350 15862627961 15366 -842693467 58570355880 57667039791 59413049347 -14433 -4871 2053379412 32854 52 -2135787575 2057268348 15862627961 -635556 -842693467 5813994110 3928571714 6656687577 --13633 -2237 1902023838 -33528 -61 2937914773 -325765486 15862627961 946703 434021400 6075598454 6071369072 5641577054 -2376 NULL NULL NULL NULL 434021400 434021400 434021400 -2376 434021400 434021400 434021400 NULL -44761 -2174 427197269 -47906 -48 1292597347 2083707724 15862627961 185288 434021400 63348565756 63779944434 62914544356 -22116 -10720 -1011669561 11551 -111 3390925772 2308428293 15862627961 -717082 434021400 10221050907 8560624434 9787029507 --38792 -25184 -2141999138 20389 103 -759786886 -6189260496 15862627961 578848 -1908480893 3599815819 2671049203 5508296712 -21739 NULL NULL NULL NULL -1908480893 -1908480893 -1908480893 -21739 -1908480893 -1908480893 -1908480893 NULL 20191 27371 -1991133944 -21024 45 -5827242947 -7575372256 15862627961 -1758 -1908480893 30420363606 28492735496 32328844499 9669 23277 1282464673 2147 36 -6330479452 -325765486 15862627961 -368590 -1908480893 10354331249 10785709927 12262812142 -87389 NULL 912707948 40175 97 -83707341 -541722291 15862627961 125217 240273900 16594069513 15417579035 16353795613 29533 NULL NULL NULL NULL 240273900 240273900 240273900 29533 240273900 240273900 240273900 NULL 51186 -236 61035129 56537 -43 442527985 1392032876 15862627961 183649 240273900 65599174579 65740393535 65358900679 117434 30045 -1143802338 31106 125 -407508384 -83707341 15862627961 136313 240273900 -491167652 -1394483741 -731441552 -14062 11006 1413111008 -15056 -60 -1285298976 1303653581 15862627961 600587 -928766616 2671049203 529050065 3599815819 -21481 NULL NULL NULL NULL -928766616 -928766616 -928766616 -21481 -928766616 -928766616 -928766616 NULL 13355 -14960 -1011669561 39749 97 -2950092371 -3475337943 15862627961 -1256 -928766616 56738273175 55728616981 57667039791 -35127 -38183 431378678 29390 -2 -1045189740 -3184474087 15862627961 -390071 -928766616 12262812142 10354331249 13191578758 -33616 -12399 2030965207 -6115 13 2641271504 974546445 15862627961 866208 794623392 9618016673 9988992488 8823393281 12636 NULL NULL NULL NULL 794623392 794623392 794623392 12636 794623392 794623392 794623392 NULL 96002 46002 715235348 30466 123 2272791696 3554144565 15862627961 193025 794623392 57047716212 57810649168 56253092820 12762 -33253 1993193190 -31054 -43 2856840301 3300694238 15862627961 -621575 794623392 7039234680 8338954313 6244611288 -20255 8988 1824882165 43647 -38 -2263607335 -1339125374 15862627961 525969 -2138770630 10983774632 12172060572 13122545262 21456 NULL NULL NULL NULL -2138770630 -2138770630 -2138770630 21456 -2138770630 -2138770630 -2138770630 NULL -6276 -18655 -2141999138 29416 -59 -6422221472 -8346656693 15862627961 -8321 -2138770630 20146078803 18004627099 22284849433 38577 27310 -1009656194 -17538 68 -3241149212 -1025454778 15862627961 -272516 -2138770630 2740082699 3503015655 4878853329 -11625 36363 2051224722 -31438 97 -2878810989 -1380600149 15862627961 624311 -335410409 11452257685 11318043778 11787668094 18384 NULL NULL NULL NULL -335410409 -335410409 -335410409 18384 -335410409 -335410409 -335410409 NULL -5940 -16388 -382483011 34619 -79 -1064883047 -875807693 15862627961 92637 -335410409 64903708596 64556718969 65239119005 -17721 7017 2033001162 31696 118 -1441635278 -3888467183 15862627961 -373930 -335410409 4074959867 5668760271 4410370276 -22255 28868 -1302295658 2147 22 1874406893 5455080817 15862627961 799510 2064155045 9994173560 10664671458 7930018515 13788 NULL NULL NULL NULL 2064155045 2064155045 2064155045 13788 2064155045 2064155045 2064155045 NULL 15973 6135 2051224722 -6012 -56 6168759179 6314333421 15862627961 238009 2064155045 6314333421 8367712833 4250178376 -2090 4523 -1991133944 10843 17 6149069904 2245382708 15862627961 -553725 2064155045 7932609446 5833804210 5868454401 -47750 11580 -1448995523 39440 113 -1049567811 2291766377 15862627961 947475 -237425046 5017916272 6231843261 5255341318 5281 NULL NULL NULL NULL -237425046 -237425046 -237425046 5281 -237425046 -237425046 -237425046 NULL 11013 -22782 -346989627 33255 122 -919825082 -649370650 15862627961 97918 -237425046 65239119005 64903708596 65476544051 53530 17360 -2117946883 20389 -99 2759425399 -2709994284 15862627961 -710197 -237425046 10607286643 10498313277 10844711689 -117434 77259 1299719633 16302 122 -407508384 -1995762929 15862627961 901298 -1331533190 5530480458 7523673648 6862013648 10837 NULL NULL NULL NULL -1331533190 -1331533190 -1331533190 10837 -1331533190 -1331533190 -1331533190 NULL 55239 34790 -1383162419 16010 77 -4054281762 -5032853316 15862627961 -30296 -1331533190 47450052344 46110466191 48781585534 37269 -2906 141218956 87389 -101 -1574720463 -1583998862 15862627961 -658464 -1331533190 9000614313 8831855982 10332147503 --38792 -25184 2025611582 20389 36 -759786886 -6189260496 15862627961 712350 -1808210365 2191096542 2252131671 3999306907 -16312 NULL NULL NULL NULL -1808210365 -1808210365 -1808210365 -16312 -1808210365 -1808210365 -1808210365 NULL -84359 -36697 -1882293856 31902 -61 -5504439770 -6300794780 15862627961 -67556 -1808210365 39809671411 37995735862 41617881776 9669 23277 439738328 2147 30 -6330479452 -325765486 15862627961 -496665 -1808210365 11863321054 12486424572 13671531419 -54956 -546 397430452 -17958 -72 -774892077 -1392370326 15862627961 266156 -1383162419 16677615270 18003483588 18060777689 27138 NULL NULL NULL NULL -1383162419 -1383162419 -1383162419 27138 -1383162419 -1383162419 -1383162419 NULL 10111 -19200 -1660426473 20449 71 -4492584415 -5356577420 15862627961 -35654 -1383162419 44727303772 43278308249 46110466191 46712 -8790 -537142430 36986 70 -1775723035 1258109085 15862627961 -7021 -1383162419 -2198149728 -1010059745 -814987309 -41786 27361 NULL -5204 13 2529191423 5168794507 15862627961 32514 -467659022 15862627961 15862627961 16330286983 32514 NULL NULL NULL NULL -467659022 -467659022 -467659022 32514 -467659022 -467659022 -467659022 NULL 91279 40283 -587831330 -29605 112 -1592632782 -1618174126 15862627961 103858 -467659022 63285534470 62748392040 63753193492 12156 -2269 -1176490478 12207 NULL 3137829300 2291766377 15862627961 231997 -467659022 -467659022 445048926 NULL -59319 7837 -1991133944 11551 -5 1840350039 2245382708 15862627961 853572 370975815 9988992488 12019957695 9618016673 13080 NULL NULL NULL NULL 370975815 370975815 370975815 13080 370975815 370975815 370975815 NULL 50607 -7301 141218956 13121 -25 752468671 1578956245 15862627961 196729 370975815 65358900679 65599174579 64987924864 47245 -4237 1299719633 30451 -95 181227663 2427194517 15862627961 -608495 370975815 6244611288 7039234680 5873635473 --16856 -4018 762932956 NULL 118 -187208211 828690732 15862627961 586719 2051224722 13369268500 12359612306 11318043778 19316 NULL NULL NULL NULL 2051224722 2051224722 2051224722 19316 2051224722 2051224722 2051224722 NULL 25213 31720 2033001162 9838 93 6131863244 8275464464 15862627961 236863 2051224722 10418937555 12466574915 8367712833 -12838 NULL -335410409 -5985 47 828690732 -2114836321 15862627961 -335406 2051224722 4544584183 4410370276 2493359461 --7120 2479 -108973366 36740 -106 -888530120 846995940 15862627961 953631 1436496767 7482261567 5364314684 6045764800 194 NULL NULL NULL NULL 1436496767 1436496767 1436496767 194 1436496767 1436496767 1436496767 NULL -5953 -22265 1413111008 -43603 -12 4273565571 6050294921 15862627961 259399 1436496767 39294596545 40718554341 37858099778 -611 8988 1902023838 -29587 -59 2660931489 -2190825778 15862627961 -721440 1436496767 9816863161 7889235051 8380366394 -42295 72839 -1339586153 -31054 -12 1466043674 1253036374 15862627961 909464 702611616 7784111103 7363068637 7081499487 -7688 NULL NULL NULL NULL 702611616 702611616 702611616 -7688 702611616 702611616 702611616 NULL -18099 -47482 659422734 66746 -40 2032532248 2887221188 15862627961 113643 702611616 59934937400 60605435298 59232325784 -31090 -546 -382483011 80491 112 3395035512 1863474126 15862627961 -685155 702611616 8781128474 10270861714 8078516858 --68124 -47322 -134213907 -57682 1 5160673327 7362171447 15862627961 642478 1593800404 11787668094 11452257685 10193867690 18167 NULL NULL NULL NULL 1593800404 1593800404 1593800404 18167 1593800404 1593800404 1593800404 NULL -51962 -40668 1544188174 -29582 64 4717865318 6846112668 15862627961 233963 1593800404 33244301624 34824178364 31650501220 -48148 -27346 852509237 -71880 38 5218698356 6899004582 15862627961 -392314 1593800404 5668760271 7701761433 4074959867 --56933 -27346 -1090239422 -9599 93 -1044244963 437338198 15862627961 842457 -1885422396 10048633851 9205940384 11934056247 -12612 NULL NULL NULL NULL -1885422396 -1885422396 -1885422396 -12612 -1885422396 -1885422396 -1885422396 NULL -43877 -22853 -1908480893 -68859 -24 -5693078400 -7389862166 15862627961 1303 -1885422396 34228019610 32328844499 36113442006 -7120 22467 586844478 -12255 -101 -888530120 1009134449 15862627961 -623072 -1885422396 3928571714 5981951126 5813994110 --39770 -15328 623103518 5494 54 1609316679 1981771941 15862627961 659133 994303988 2936465061 3376203389 1942161073 -18218 NULL NULL NULL NULL 994303988 994303988 994303988 -18218 994303988 994303988 994303988 NULL 27948 29256 852509237 32012 -85 2759521173 4542648191 15862627961 223491 994303988 54487875635 55400583583 53493571647 -32689 -8247 -2141999138 -31438 -48 1584341489 1303653581 15862627961 -445354 994303988 13920466888 15333577896 12926162900 -34485 17970 -629486480 33142 77 -9207907 1195987713 15862627961 756174 383352709 9745728509 7846553398 9362375800 15295 NULL NULL NULL NULL 383352709 383352709 383352709 15295 383352709 383352709 383352709 NULL 94879 38342 240273900 -24360 14 994602424 1639359108 15862627961 212024 383352709 64987924864 65358900679 64604572155 24352 7837 670497898 -6115 45 433054757 -1392370326 15862627961 -508882 383352709 6500252161 5197956503 6116899452 -44727 27310 1955646088 60858 31 2940130772 -3871666709 15862627961 415116 715235348 14618057582 14030226252 13902822234 23388 NULL NULL NULL NULL 715235348 715235348 715235348 23388 715235348 715235348 715235348 NULL 73515 6769 702611616 50000 -38 2124288232 3125300933 15862627961 159645 715235348 58525884516 59232325784 57810649168 53780 36363 706441268 8900 49 -1972491598 1796328434 15862627961 -159731 715235348 1959805727 1159243956 1244570379 -35484 23277 -800561771 14425 68 1728676075 4109068163 15862627961 482937 1824882165 13996942737 14703384005 12172060572 22080 NULL NULL NULL NULL 1824882165 1824882165 1824882165 22080 1824882165 1824882165 1824882165 NULL -12886 -8359 1689098844 -1133 55 5252312264 7673725065 15862627961 204381 1824882165 28223071121 29961402376 26398188956 41786 29579 -2138770630 28558 -40 2529191423 775314354 15862627961 -228860 1824882165 3690567389 4878853329 1865685224 -68836 12398 715235348 10843 -82 2056218702 887668931 15862627961 460857 706441268 14703384005 13902822234 13996942737 22614 NULL NULL NULL NULL 706441268 706441268 706441268 22614 706441268 706441268 706441268 NULL 22263 -16051 670497898 56768 52 2079550782 2979232964 15862627961 136257 706441268 59232325784 59934937400 58525884516 54201 -2237 1188285940 33142 31 447930603 1519076272 15862627961 -206246 706441268 1865685224 3690567389 1159243956 --39770 -15328 -1011669561 5494 41 1609316679 1981771941 15862627961 934121 1354539333 6733796348 8313673088 5379257015 -3855 NULL NULL NULL NULL 1354539333 1354539333 1354539333 -3855 1354539333 1354539333 1354539333 NULL -4696 40365 1325868318 7070 54 4017450800 5628104904 15862627961 252329 1354539333 43486204682 44823247831 42131665349 -32689 -8247 -1339586153 -31438 -90 1584341489 1303653581 15862627961 -705979 1354539333 10483370946 9839145477 9128831613 --611 -37351 852509237 -33532 -44 2660931489 -1025454778 15862627961 709418 49866617 7266933535 7308357291 7217066918 15874 NULL NULL NULL NULL 49866617 49866617 49866617 15874 49866617 49866617 49866617 NULL 18051 1950 -4229382 22232 30 87060991 492394602 15862627961 161417 49866617 65851295281 65892719037 65801428664 31670 -5070 -1899175111 -9599 62 1113315852 3560913151 15862627961 -461547 49866617 8645561043 8016074563 8595694426 -54201 43358 41423756 -6613 45 447930603 2308428293 15862627961 725206 -629486480 7217066918 7266933535 7846553398 15788 NULL NULL NULL NULL -629486480 -629486480 -629486480 15788 -629486480 -629486480 -629486480 NULL 30673 -4943 -673237643 82314 49 -1946949592 -2222119262 15862627961 21544 -629486480 61531074230 60886848761 62160560710 22255 11412 383352709 56438 68 1874406893 1210863559 15862627961 -477421 -629486480 8016074563 6116899452 8645561043 --68124 -47322 -1176490478 -57682 57 5160673327 7362171447 15862627961 154323 -903316089 16353795613 16594069513 17257111702 29106 NULL NULL NULL NULL -903316089 -903316089 -903316089 29106 -903316089 -903316089 -903316089 NULL 12927 17786 -1009656194 -17427 -101 -2841738899 -3219808970 15862627961 27850 -903316089 57667039791 56738273175 58570355880 -48148 -27346 397430452 -71880 123 5218698356 6899004582 15862627961 106780 -903316089 -1394483741 -2538286079 -491167652 --55630 -46744 -1813935549 -12255 3 5156491918 3321754114 15862627961 294005 427197269 2630808177 1408274187 2203610908 -30336 NULL NULL NULL NULL 427197269 427197269 427197269 -30336 427197269 427197269 427197269 NULL 4015 28375 383352709 -42587 103 1207980430 1732335675 15862627961 209850 427197269 64207141703 64604572155 63779944434 -8499 387 1544188174 -12652 -117 4624049772 5587870596 15862627961 -92344 427197269 13659017053 14318439787 13231819784 -9669 -10720 1325868318 36170 -29 -6330479452 775314354 15862627961 291746 1188089983 18060777689 16677615270 16872687706 25590 NULL NULL NULL NULL 1188089983 1188089983 1188089983 25590 1188089983 1188089983 1188089983 NULL 45858 13846 994303988 4688 68 3354362251 4872767585 15862627961 233927 1188089983 52321603367 53493571647 51133513384 47750 27361 1423957796 -13608 -8 -1049567811 -7024468539 15862627961 -34159 1188089983 -1010059745 -1547202175 -2198149728 -87389 NULL 1593800404 40175 62 -83707341 -541722291 15862627961 677207 852509237 8160866528 10193867690 7308357291 16620 NULL NULL NULL NULL 852509237 852509237 852509237 16620 852509237 852509237 852509237 NULL 105452 44132 762932956 -1308 13 2410065585 3931489453 15862627961 209645 852509237 56253092820 57047716212 55400583583 117434 30045 49866617 31106 1 -407508384 -83707341 15862627961 -428590 852509237 8554270670 8595694426 7701761433 --22116 11412 1188089983 -26471 -5 3390925772 -7024468539 15862627961 342337 1423957796 17409830136 16872687706 15985872340 25286 NULL NULL NULL NULL 1423957796 1423957796 1423957796 25286 1423957796 1423957796 1423957796 NULL -19581 -26651 1354539333 -40474 71 4191608137 5894375977 15862627961 259205 1423957796 40718554341 42131665349 39294596545 -21948 11580 -587831330 -11396 -29 -6071106818 5455080817 15862627961 -85054 1423957796 -123244379 1832401709 -1547202175 --31020 23125 -1882293856 -12652 64 1208315423 6899004582 15862627961 437586 1738331255 2348531094 4339704068 610199839 -25136 NULL NULL NULL NULL 1738331255 1738331255 1738331255 -25136 1738331255 1738331255 1738331255 NULL -14350 15232 1593800404 45505 -82 5021230503 7420883346 15862627961 182301 1738331255 29961402376 31650501220 28223071121 -44611 9534 -673237643 16302 102 4160882907 1074101516 15862627961 -230725 1738331255 15252428122 16941526966 13514096867 -20625 6926 -1660426473 11361 29 2284185998 3645319585 15862627961 937976 1579876740 8313673088 7302003527 6733796348 -2935 NULL NULL NULL NULL 1579876740 1579876740 1579876740 -2935 1579876740 1579876740 1579876740 NULL -25242 -8974 1489733240 -33495 97 4613798154 6601107243 15862627961 215796 1579876740 34824178364 36368366538 33244301624 40940 27241 -644225469 39440 -107 5636453529 4109068163 15862627961 -708914 1579876740 9128831613 10483370946 7548954873 -77259 NULL -467659022 67120 123 -1176490478 -1583998862 15862627961 95684 -1176490478 15417579035 16330286983 16594069513 31106 NULL NULL NULL NULL -1176490478 -1176490478 -1176490478 31106 -1176490478 -1176490478 -1176490478 NULL 55628 25928 -1302295658 13821 57 -3701320126 -4422201799 15862627961 -14286 -1176490478 51306415182 50083881192 52482905660 98226 20967 -903316089 NULL 13 -252465672 -1176490478 15862627961 167419 -1176490478 -731441552 -491167652 445048926 -47245 35694 -1808210365 -11396 29 181227663 6588808232 15862627961 677351 439738328 3376203389 3999306907 2936465061 -18025 NULL NULL NULL NULL 439738328 439738328 439738328 -18025 439738328 439738328 439738328 NULL -85830 -52522 431378678 -60389 -31 1305138406 2309109058 15862627961 167263 439738328 62914544356 63348565756 62474806028 -13633 -25184 1413111008 51482 36 2937914773 887668931 15862627961 -463379 439738328 12926162900 13920466888 12486424572 -2003 30045 -644225469 -71880 5 -664229739 3739840441 15862627961 917152 -421042466 7363068637 6023482484 7784111103 -6823 NULL NULL NULL NULL -421042466 -421042466 -421042466 -6823 -421042466 -421042466 -421042466 NULL 65926 49800 -537142430 -4398 73 -1425843918 -1485925513 15862627961 97035 -421042466 63753193492 63285534470 64174235958 -74786 -46744 1489733240 33962 71 1748667467 -1995762929 15862627961 -691978 -421042466 8078516858 8781128474 8499559324 --74786 -2906 -928766616 -20802 73 1748667467 5587870596 15862627961 556662 431378678 5508296712 3599815819 5076918034 -22186 NULL NULL NULL NULL 431378678 431378678 431378678 -22186 431378678 431378678 431378678 NULL -11441 43457 397430452 -33308 -54 1256006399 1891982884 15862627961 187664 431378678 63779944434 64207141703 63348565756 -68124 3756 1337043149 -28042 -60 5160673327 1639694101 15862627961 -346851 431378678 10785709927 12068174600 10354331249 --1210 -38196 994303988 55502 36 550424758 714841163 15862627961 622068 -2141999138 529050065 1942161073 2671049203 -18655 NULL NULL NULL NULL -2141999138 -2141999138 -2141999138 -18655 -2141999138 -2141999138 -2141999138 NULL -29777 NULL NULL 12379 -72 -2141999138 -8540168355 15862627961 -18655 -2141999138 15862627961 15862627961 18004627099 54956 17970 -1908480893 -20087 54 -774892077 1253036374 15862627961 -408726 -2141999138 13191578758 12262812142 15333577896 -12762 18877 -421042466 16515 73 2856840301 -546350337 15862627961 900296 1489733240 7081499487 7784111103 5591766247 -9168 NULL NULL NULL NULL 1489733240 1489733240 1489733240 -9168 1489733240 1489733240 1489733240 NULL -33598 6876 1423957796 -16268 -56 4350187803 6207598558 15862627961 250231 1489733240 37858099778 39294596545 36368366538 34485 40600 -2141451704 46015 5 -9207907 714841163 15862627961 -677467 1489733240 10270861714 9888378703 8781128474 -57823 -22668 370975815 -30544 -101 3944161437 2125466408 15862627961 878821 1299719633 8823393281 9618016673 7523673648 12613 NULL NULL NULL NULL 1299719633 1299719633 1299719633 12613 1299719633 1299719633 1299719633 NULL 45053 27189 1213926989 1101 70 3796111295 5317170433 15862627961 251228 1299719633 47448835782 48731300455 46149116149 42295 -38196 -1331533190 5494 -5 1466043674 1845356201 15862627961 -634211 1299719633 8338954313 10332147503 7039234680 --8499 3756 2047637360 -29587 -85 4624049772 -144263301 15862627961 775806 2143473091 7593184624 7246194997 5449711533 -14704 NULL NULL NULL NULL 2143473091 2143473091 2143473091 -14704 2143473091 2143473091 2143473091 NULL -4866 1146 2064155045 NULL NULL 6314333421 2143473091 15862627961 231997 2143473091 2143473091 4250178376 NULL -56933 -44678 2025611582 -8886 -101 -1044244963 7362171447 15862627961 -558513 2143473091 10412916428 11584884708 8269443337 -98226 31106 1993193190 33962 -76 -252465672 -1743478794 15862627961 911428 -168758331 6862013648 5530480458 7030771979 10130 NULL NULL NULL NULL -168758331 -168758331 -168758331 10130 -168758331 -168758331 -168758331 NULL 39786 5167 -335410409 21158 118 -741593786 -416174986 15862627961 108048 -168758331 65476544051 65239119005 65645302382 90245 23125 2106705285 77259 120 -1634505428 -252465672 15862627961 -669301 -168758331 8831855982 8973074938 9000614313 -36394 -8247 141218956 -20087 -99 1160862510 1946039989 15862627961 936581 -1448995523 4782847738 6889553023 6231843261 7652 NULL NULL NULL NULL -1448995523 -1448995523 -1448995523 7652 -1448995523 -1448995523 -1448995523 NULL -12872 -44774 -1808210365 32496 -8 -4917632361 -5503277285 15862627961 -62792 -1448995523 43278308249 41617881776 44727303772 32242 -12399 -237425046 36430 -56 -86961173 2495165914 15862627961 -696932 -1448995523 9630784700 10844711689 11079780223 --21948 4523 -4229382 28558 -107 -6071106818 -2709994284 15862627961 943815 -1660426473 5641577054 6075598454 7302003527 -2888 NULL NULL NULL NULL -1660426473 -1660426473 -1660426473 -2888 -1660426473 -1660426473 -1660426473 NULL -64095 -52547 -1813935549 29311 12 -5282572387 -5832170568 15862627961 -70444 -1660426473 41617881776 39809671411 43278308249 -12381 14090 1579876740 -33528 -54 -2472569238 -2420213359 15862627961 -714706 -1660426473 8560624434 7548954873 10221050907 -2913 -2269 2106705285 -18079 -79 1253758252 -921860586 15862627961 942194 1213926989 6231843261 4782847738 5017916272 5613 NULL NULL NULL NULL 1213926989 1213926989 1213926989 5613 1213926989 1213926989 1213926989 NULL 15124 10436 1188089983 17864 73 3590302912 5121979613 15862627961 261116 1213926989 49945227444 51133513384 48731300455 1164 -4018 -108973366 11361 12 89808975 3279369834 15862627961 -704584 1213926989 10844711689 10607286643 9630784700 --7120 2479 1354539333 36740 112 -888530120 846995940 15862627961 923975 -1339586153 6023482484 5379257015 7363068637 -5479 NULL NULL NULL NULL -1339586153 -1339586153 -1339586153 -5479 -1339586153 -1339586153 -1339586153 NULL 37260 4764 -1448995523 -4259 120 -4171744095 -5195948991 15862627961 -41133 -1339586153 46110466191 44727303772 47450052344 -611 8988 702611616 -29587 41 2660931489 -2190825778 15862627961 -697457 -1339586153 8499559324 8078516858 9839145477 -12156 17360 2143473091 32854 30 3137829300 3279369834 15862627961 744772 2025611582 4277743253 5449711533 2252131671 -15880 NULL NULL NULL NULL 2025611582 2025611582 2025611582 -15880 2025611582 2025611582 2025611582 NULL 9709 338 1991172974 18539 -95 6009977746 8137215311 15862627961 199008 2025611582 18556152866 20549346056 16530541284 14039 19243 -1808210365 14425 -85 2065442845 4309797580 15862627961 -528655 2025611582 13610496290 13671531419 11584884708 query IIIIIII @@ -587,106 +187,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c8; ---- -102 33715 48099 10 31648 28086 10 -299 NULL 10 10 7781 0 10 -363 17910 40566 10 48048 27744 10 -417 18736 53000 10 45185 29458 10 -794 44507 49283 10 3583 40622 10 -829 33821 11872 10 61069 59663 10 -832 53012 2684 10 40622 48483 10 -1535 34970 48048 10 50842 2516 10 -2516 57594 17910 10 34970 36599 10 -2555 24770 34970 10 28086 53000 10 -2684 47061 57751 10 12876 14722 10 -2809 56980 3691 10 64517 27600 10 -2986 35477 28086 10 12757 45185 10 -3583 794 24022 10 35429 44507 10 -3691 50009 35429 10 63353 5494 10 -3975 59134 10 10 39363 30972 10 -4168 24022 829 10 15573 49283 10 -5382 12393 31648 10 24380 12757 10 -5494 21119 794 10 50009 52046 10 -7781 299 10 10 30972 0 10 -9489 52286 32712 10 14337 34331 10 -9832 20807 12393 10 34331 17835 10 -11872 39363 10 10 57885 3975 10 -12393 12757 102 10 5382 2986 10 -12757 2986 33715 10 12393 35477 10 -12876 2684 29527 10 45253 47061 10 -13763 15573 53815 10 48483 4168 10 -14337 9489 15777 10 43062 52286 10 -14722 53815 54276 10 47061 61069 10 -15573 4168 61069 10 13763 24022 10 -15777 32712 18736 10 62167 24380 10 -17835 57510 2986 10 20807 45465 10 -17910 27744 34206 10 363 20421 10 -18736 29458 39635 10 417 35106 10 -20120 57885 10 10 54276 11872 10 -20421 63353 23948 10 27744 3691 10 -20807 17835 12757 10 9832 57510 10 -21119 52046 44507 10 5494 40566 10 -21463 48099 56980 10 43655 50842 10 -23948 61637 13763 10 55620 35429 10 -24022 49283 33821 10 4168 45253 10 -24380 5382 35106 10 32712 12393 10 -24770 53000 2516 10 2555 39635 10 -27034 48048 21119 10 27600 363 10 -27600 27034 5494 10 56980 48048 10 -27744 20421 55620 10 17910 63353 10 -28086 2555 1535 10 33715 24770 10 -29458 35106 52569 10 18736 31648 10 -29527 57751 30972 10 30296 42171 10 -30296 29527 59134 10 59663 57751 10 -30972 7781 10 10 59134 299 10 -31648 102 21463 10 35106 33715 10 -32712 24380 29458 10 15777 5382 10 -33715 28086 50842 10 102 2555 10 -33821 59663 39363 10 829 30296 10 -34206 55620 53012 10 40566 23948 10 -34331 9832 5382 10 52286 20807 10 -34970 2516 363 10 1535 57594 10 -35106 31648 43655 10 29458 102 10 -35429 3583 4168 10 61637 794 10 -35477 45185 2555 10 2986 417 10 -36599 64517 20421 10 57594 2809 10 -39363 3975 10 10 11872 59134 10 -39635 52569 36599 10 53000 43655 10 -40566 34206 832 10 52046 55620 10 -40622 832 12876 10 44507 53012 10 -42171 54276 299 10 57751 20120 10 -43062 14337 62167 10 NULL 9489 10 -43655 21463 2809 10 52569 48099 10 -44507 40622 45253 10 794 832 10 -45185 417 24770 10 35477 18736 10 -45253 12876 30296 10 49283 2684 10 -45465 62167 45185 10 57510 15777 10 -47061 14722 42171 10 2684 53815 10 -48048 363 52046 10 27034 17910 10 -48099 50842 27600 10 21463 1535 10 -48483 13763 14722 10 53012 15573 10 -49283 45253 59663 10 24022 12876 10 -50009 5494 3583 10 3691 21119 10 -50842 1535 27034 10 48099 34970 10 -52046 40566 40622 10 21119 34206 10 -52286 34331 24380 10 9489 9832 10 -52569 43655 64517 10 39635 21463 10 -53000 39635 57594 10 24770 52569 10 -53012 48483 47061 10 832 13763 10 -53815 61069 20120 10 14722 829 10 -54276 20120 10 10 42171 57885 10 -55620 23948 48483 10 34206 61637 10 -56980 27600 50009 10 2809 27034 10 -57510 45465 35477 10 17835 62167 10 -57594 36599 27744 10 2516 64517 10 -57751 42171 7781 10 29527 54276 10 -57885 11872 10 10 20120 39363 10 -59134 30972 10 10 3975 7781 10 -59663 30296 3975 10 33821 29527 10 -61069 829 57885 10 53815 33821 10 -61637 35429 15573 10 23948 3583 10 -62167 15777 417 10 45465 32712 10 -63353 3691 61637 10 20421 50009 10 -64517 2809 63353 10 36599 56980 10 query IIIRIIIIII @@ -704,106 +204,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY row_number; ---- -225513085 1 6 16.681818181818 367 125 -99 0 -1 -47 -473294098 2 11 16.681818181818 367 125 -99 0 -1 -47 -520189543 3 12 16.681818181818 367 125 -99 0 -1 -47 -774637006 4 19 16.681818181818 367 125 -99 0 -1 -47 -879082834 5 21 16.681818181818 367 125 -99 0 -1 -47 -1454057357 6 34 16.681818181818 367 125 -99 0 -1 -47 -1842680163 7 40 16.681818181818 367 125 -99 0 -1 -47 -2125812933 8 46 16.681818181818 367 125 -99 0 -1 -47 -2610290479 9 56 16.681818181818 367 125 -99 0 -1 -47 -2669374863 10 57 16.681818181818 367 125 -99 0 -1 -47 -2712615025 11 59 16.681818181818 367 125 -99 0 -1 -47 -2830981072 12 62 16.681818181818 367 125 -99 0 -1 -47 -2861376515 13 64 16.681818181818 367 125 -99 0 -1 -47 -3275293996 14 72 16.681818181818 367 125 -99 0 -1 -47 -3276123488 15 73 16.681818181818 367 125 -99 0 -1 -47 -3542840110 16 82 16.681818181818 367 125 -99 0 -1 -47 -3625286410 17 87 16.681818181818 367 125 -99 0 -1 -47 -3766999078 18 90 16.681818181818 367 125 -99 0 -1 -47 -4015442341 19 94 16.681818181818 367 125 -99 0 -1 -47 -4076864659 20 96 16.681818181818 367 125 -99 0 -1 -47 -4216440507 21 98 16.681818181818 367 125 -99 0 -1 -47 -4229654142 22 99 16.681818181818 367 125 -99 0 -1 -47 -63044568 23 2 12.522727272727 551 125 -117 0 -1 47 -141680161 24 4 12.522727272727 551 125 -117 0 -1 47 -145294611 25 5 12.522727272727 551 125 -117 0 -1 47 -598822671 26 16 12.522727272727 551 125 -117 0 -1 47 -1000948272 27 24 12.522727272727 551 125 -117 0 -1 47 -1098639440 28 27 12.522727272727 551 125 -117 0 -1 47 -1157161427 29 28 12.522727272727 551 125 -117 0 -1 47 -1289293657 30 31 12.522727272727 551 125 -117 0 -1 47 -1491205016 31 35 12.522727272727 551 125 -117 0 -1 47 -2013662838 32 43 12.522727272727 551 125 -117 0 -1 47 -2293105904 33 48 12.522727272727 551 125 -117 0 -1 47 -2525744318 34 54 12.522727272727 551 125 -117 0 -1 47 -2705709344 35 58 12.522727272727 551 125 -117 0 -1 47 -2844041986 36 63 12.522727272727 551 125 -117 0 -1 47 -2939920218 37 66 12.522727272727 551 125 -117 0 -1 47 -3188005828 38 70 12.522727272727 551 125 -117 0 -1 47 -3314983189 39 74 12.522727272727 551 125 -117 0 -1 47 -3398507249 40 77 12.522727272727 551 125 -117 0 -1 47 -3455216719 41 78 12.522727272727 551 125 -117 0 -1 47 -3717551163 42 88 12.522727272727 551 125 -117 0 -1 47 -4061635107 43 95 12.522727272727 551 125 -117 0 -1 47 -4144173353 44 97 12.522727272727 551 125 -117 0 -1 47 -243203849 45 7 15.015873015873 946 125 -117 0 -1 74 -431948861 46 9 15.015873015873 946 125 -117 0 -1 74 -559847112 47 15 15.015873015873 946 125 -117 0 -1 74 -754775609 48 18 15.015873015873 946 125 -117 0 -1 74 -1088543984 49 26 15.015873015873 946 125 -117 0 -1 74 -1362369177 50 32 15.015873015873 946 125 -117 0 -1 74 -1538863055 51 37 15.015873015873 946 125 -117 0 -1 74 -1824517658 52 39 15.015873015873 946 125 -117 0 -1 74 -1995343206 53 42 15.015873015873 946 125 -117 0 -1 74 -2093538928 54 45 15.015873015873 946 125 -117 0 -1 74 -2214035726 55 47 15.015873015873 946 125 -117 0 -1 74 -2592330556 56 55 15.015873015873 946 125 -117 0 -1 74 -3105312559 57 68 15.015873015873 946 125 -117 0 -1 74 -3473924576 58 80 15.015873015873 946 125 -117 0 -1 74 -3577318119 59 85 15.015873015873 946 125 -117 0 -1 74 -3759340273 60 89 15.015873015873 946 125 -117 0 -1 74 -3862393166 61 91 15.015873015873 946 125 -117 0 -1 74 -3959216334 62 92 15.015873015873 946 125 -117 0 -1 74 -3998790955 63 93 15.015873015873 946 125 -117 0 -1 74 -28774375 64 1 11.337209302326 975 125 -117 0 -1 69 -326151275 65 8 11.337209302326 975 125 -117 0 -1 69 -466439833 66 10 11.337209302326 975 125 -117 0 -1 69 -538589788 67 13 11.337209302326 975 125 -117 0 -1 69 -557517119 68 14 11.337209302326 975 125 -117 0 -1 69 -811650497 69 20 11.337209302326 975 125 -117 0 -1 69 -933879086 70 22 11.337209302326 975 125 -117 0 -1 69 -1243785310 71 30 11.337209302326 975 125 -117 0 -1 69 -1534194097 72 36 11.337209302326 975 125 -117 0 -1 69 -1787652631 73 38 11.337209302326 975 125 -117 0 -1 69 -1865307672 74 41 11.337209302326 975 125 -117 0 -1 69 -2042457019 75 44 11.337209302326 975 125 -117 0 -1 69 -2306130875 76 49 11.337209302326 975 125 -117 0 -1 69 -2502326480 77 53 11.337209302326 975 125 -117 0 -1 69 -2778168728 78 60 11.337209302326 975 125 -117 0 -1 69 -2818832252 79 61 11.337209302326 975 125 -117 0 -1 69 -3023531799 80 67 11.337209302326 975 125 -117 0 -1 69 -3126475872 81 69 11.337209302326 975 125 -117 0 -1 69 -3198969145 82 71 11.337209302326 975 125 -117 0 -1 69 -3521368277 83 81 11.337209302326 975 125 -117 0 -1 69 -3566741189 84 83 11.337209302326 975 125 -117 0 -1 69 -3570297463 85 84 11.337209302326 975 125 -117 0 -1 69 -3593959807 86 86 11.337209302326 975 125 -117 0 -1 69 -141047417 87 3 7.81 781 125 -117 0 -1 -61 -662099130 88 17 7.81 781 125 -117 0 -1 -61 -974297360 89 23 7.81 781 125 -117 0 -1 -61 -1013876852 90 25 7.81 781 125 -117 0 -1 -61 -1229567292 91 29 7.81 781 125 -117 0 -1 -61 -1365198901 92 33 7.81 781 125 -117 0 -1 -61 -2307004493 93 50 7.81 781 125 -117 0 -1 -61 -2424630722 94 51 7.81 781 125 -117 0 -1 -61 -2496054700 95 52 7.81 781 125 -117 0 -1 -61 -2861911482 96 65 7.81 781 125 -117 0 -1 -61 -3342719438 97 75 7.81 781 125 -117 0 -1 -61 -3373581039 98 76 7.81 781 125 -117 0 -1 -61 -3457053821 99 79 7.81 781 125 -117 0 -1 -61 -4268716378 100 100 7.81 781 125 -117 0 -1 -61 query IIIRIIIIII @@ -821,106 +221,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -28774375 1 23 1.260869565217 29 123 -117 0 -1 15 -63044568 1 22 8.363636363636 184 122 -117 0 -1 -2 -141047417 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -141680161 1 22 8.363636363636 184 122 -117 0 -1 -2 -145294611 1 22 8.363636363636 184 122 -117 0 -1 -2 -225513085 1 22 16.681818181818 367 125 -99 0 -1 -47 -243203849 1 19 20.789473684211 395 123 -101 0 -1 101 -326151275 1 23 1.260869565217 29 123 -117 0 -1 15 -431948861 1 19 20.789473684211 395 123 -101 0 -1 101 -466439833 1 23 1.260869565217 29 123 -117 0 -1 15 -473294098 1 22 16.681818181818 367 125 -99 0 -1 -47 -520189543 1 22 16.681818181818 367 125 -99 0 -1 -47 -538589788 1 23 1.260869565217 29 123 -117 0 -1 15 -557517119 1 23 1.260869565217 29 123 -117 0 -1 15 -559847112 1 19 20.789473684211 395 123 -101 0 -1 101 -598822671 1 22 8.363636363636 184 122 -117 0 -1 -2 -662099130 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -754775609 1 19 20.789473684211 395 123 -101 0 -1 101 -774637006 1 22 16.681818181818 367 125 -99 0 -1 -47 -811650497 1 23 1.260869565217 29 123 -117 0 -1 15 -879082834 1 22 16.681818181818 367 125 -99 0 -1 -47 -933879086 1 23 1.260869565217 29 123 -117 0 -1 15 -974297360 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -1000948272 1 22 8.363636363636 184 122 -117 0 -1 -2 -1013876852 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -1088543984 1 19 20.789473684211 395 123 -101 0 -1 101 -1098639440 1 22 8.363636363636 184 122 -117 0 -1 -2 -1157161427 1 22 8.363636363636 184 122 -117 0 -1 -2 -1229567292 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -1243785310 1 23 1.260869565217 29 123 -117 0 -1 15 -1289293657 1 22 8.363636363636 184 122 -117 0 -1 -2 -1362369177 1 19 20.789473684211 395 123 -101 0 -1 101 -1365198901 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -1454057357 1 22 16.681818181818 367 125 -99 0 -1 -47 -1491205016 1 22 8.363636363636 184 122 -117 0 -1 -2 -1534194097 1 23 1.260869565217 29 123 -117 0 -1 15 -1538863055 1 19 20.789473684211 395 123 -101 0 -1 101 -1787652631 1 23 1.260869565217 29 123 -117 0 -1 15 -1824517658 1 19 20.789473684211 395 123 -101 0 -1 101 -1842680163 1 22 16.681818181818 367 125 -99 0 -1 -47 -1865307672 1 23 1.260869565217 29 123 -117 0 -1 15 -1995343206 1 19 20.789473684211 395 123 -101 0 -1 101 -2013662838 1 22 8.363636363636 184 122 -117 0 -1 -2 -2042457019 1 23 1.260869565217 29 123 -117 0 -1 15 -2093538928 1 19 20.789473684211 395 123 -101 0 -1 101 -2125812933 1 22 16.681818181818 367 125 -99 0 -1 -47 -2214035726 1 19 20.789473684211 395 123 -101 0 -1 101 -2293105904 1 22 8.363636363636 184 122 -117 0 -1 -2 -2306130875 1 23 1.260869565217 29 123 -117 0 -1 15 -2307004493 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -2424630722 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -2496054700 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -2502326480 1 23 1.260869565217 29 123 -117 0 -1 15 -2525744318 1 22 8.363636363636 184 122 -117 0 -1 -2 -2592330556 1 19 20.789473684211 395 123 -101 0 -1 101 -2610290479 1 22 16.681818181818 367 125 -99 0 -1 -47 -2669374863 1 22 16.681818181818 367 125 -99 0 -1 -47 -2705709344 1 22 8.363636363636 184 122 -117 0 -1 -2 -2712615025 1 22 16.681818181818 367 125 -99 0 -1 -47 -2778168728 1 23 1.260869565217 29 123 -117 0 -1 15 -2818832252 1 23 1.260869565217 29 123 -117 0 -1 15 -2830981072 1 22 16.681818181818 367 125 -99 0 -1 -47 -2844041986 1 22 8.363636363636 184 122 -117 0 -1 -2 -2861376515 1 22 16.681818181818 367 125 -99 0 -1 -47 -2861911482 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -2939920218 1 22 8.363636363636 184 122 -117 0 -1 -2 -3023531799 1 23 1.260869565217 29 123 -117 0 -1 15 -3105312559 1 19 20.789473684211 395 123 -101 0 -1 101 -3126475872 1 23 1.260869565217 29 123 -117 0 -1 15 -3188005828 1 22 8.363636363636 184 122 -117 0 -1 -2 -3198969145 1 23 1.260869565217 29 123 -117 0 -1 15 -3275293996 1 22 16.681818181818 367 125 -99 0 -1 -47 -3276123488 1 22 16.681818181818 367 125 -99 0 -1 -47 -3314983189 1 22 8.363636363636 184 122 -117 0 -1 -2 -3342719438 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -3373581039 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -3398507249 1 22 8.363636363636 184 122 -117 0 -1 -2 -3455216719 1 22 8.363636363636 184 122 -117 0 -1 -2 -3457053821 1 14 -13.857142857143 -194 118 -101 0 -1 -122 -3473924576 1 19 20.789473684211 395 123 -101 0 -1 101 -3521368277 1 23 1.260869565217 29 123 -117 0 -1 15 -3542840110 1 22 16.681818181818 367 125 -99 0 -1 -47 -3566741189 1 23 1.260869565217 29 123 -117 0 -1 15 -3570297463 1 23 1.260869565217 29 123 -117 0 -1 15 -3577318119 1 19 20.789473684211 395 123 -101 0 -1 101 -3593959807 1 23 1.260869565217 29 123 -117 0 -1 15 -3625286410 1 22 16.681818181818 367 125 -99 0 -1 -47 -3717551163 1 22 8.363636363636 184 122 -117 0 -1 -2 -3759340273 1 19 20.789473684211 395 123 -101 0 -1 101 -3766999078 1 22 16.681818181818 367 125 -99 0 -1 -47 -3862393166 1 19 20.789473684211 395 123 -101 0 -1 101 -3959216334 1 19 20.789473684211 395 123 -101 0 -1 101 -3998790955 1 19 20.789473684211 395 123 -101 0 -1 101 -4015442341 1 22 16.681818181818 367 125 -99 0 -1 -47 -4061635107 1 22 8.363636363636 184 122 -117 0 -1 -2 -4076864659 1 22 16.681818181818 367 125 -99 0 -1 -47 -4144173353 1 22 8.363636363636 184 122 -117 0 -1 -2 -4216440507 1 22 16.681818181818 367 125 -99 0 -1 -47 -4229654142 1 22 16.681818181818 367 125 -99 0 -1 -47 -4268716378 1 14 -13.857142857143 -194 118 -101 0 -1 -122 query IIIRIIIIII @@ -938,106 +238,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -28774375 1 1 30 30 30 30 30 30 30 -63044568 1 1 113 113 113 113 113 113 113 -141047417 1 1 36 36 36 36 36 36 36 -141680161 2 2 3.5 7 113 -106 16 -9 -25 -145294611 3 3 17.333333333333 52 113 -106 0 -1 -54 -225513085 1 1 -98 -98 -98 -98 -98 -98 -98 -243203849 1 1 -101 -101 -101 -101 -101 -101 -101 -326151275 2 2 38.5 77 47 30 14 63 49 -431948861 2 2 -43.5 -87 14 -101 10 -97 -107 -466439833 3 3 -8 -24 47 -101 10 -65 -86 -473294098 2 2 -14 -28 70 -98 6 -34 -40 -520189543 3 3 -17.333333333333 -52 70 -98 0 -2 48 -538589788 4 4 12.25 49 73 -101 8 -1 -29 -557517119 5 5 -1.4 -7 73 -101 8 -1 43 -559847112 3 3 -60.666666666667 -182 14 -101 0 -65 52 -598822671 4 4 5.75 23 113 -106 0 -1 41 -662099130 2 2 50 100 64 36 0 100 100 -754775609 4 4 -41.25 -165 17 -101 0 -65 37 -774637006 4 4 -34.25 -137 70 -98 0 -1 -101 -811650497 6 6 8 48 73 -101 0 -1 28 -879082834 5 5 -16 -80 70 -98 0 -1 -94 -933879086 7 7 9.285714285714 65 73 -101 0 -1 13 -974297360 3 3 56 168 68 36 0 100 32 -1000948272 5 5 23.2 116 113 -106 0 -1 116 -1013876852 4 4 34.25 137 68 -31 0 -27 -63 -1088543984 5 5 -18.4 -92 73 -101 0 -1 108 -1098639440 6 6 24.5 147 113 -106 0 -1 107 -1157161427 7 7 5.714285714286 40 113 -107 0 -1 -2 -1229567292 5 5 51 255 118 -31 0 -9 -73 -1243785310 8 8 -5.75 -46 73 -111 0 -1 -100 -1289293657 8 8 11.125 89 113 -107 0 -1 -49 -1362369177 6 6 -11.666666666667 -70 73 -101 0 -1 122 -1365198901 6 6 32.666666666667 196 118 -59 0 -9 114 -1454057357 6 6 -22.666666666667 -136 70 -98 0 -1 106 -1491205016 9 9 10 90 113 -107 0 -1 -50 -1534194097 9 9 6.222222222222 56 102 -111 0 -1 -6 -1538863055 7 7 -7.571428571429 -53 73 -101 0 -1 107 -1787652631 10 10 1.8 18 102 -111 0 -1 32 -1824517658 8 8 -16.125 -129 73 -101 0 -1 -33 -1842680163 7 7 -11.714285714286 -82 70 -98 0 -1 92 -1865307672 11 11 7.545454545455 83 102 -111 0 -1 97 -1995343206 9 9 -22.333333333333 -201 73 -101 0 -1 103 -2013662838 10 10 14.2 142 113 -107 0 -1 -6 -2042457019 12 12 15 180 102 -111 0 -1 0 -2093538928 10 10 -12.4 -124 77 -101 0 -1 42 -2125812933 8 8 -5.125 -41 70 -98 0 -1 117 -2214035726 11 11 -10.090909090909 -111 77 -101 0 -1 39 -2293105904 11 11 2.272727272727 25 113 -117 0 -1 113 -2306130875 13 13 14.076923076923 183 102 -111 0 -1 3 -2307004493 7 7 36.857142857143 258 118 -59 0 -1 76 -2424630722 8 8 31.625 253 118 -59 0 -1 -73 -2496054700 9 9 16.888888888889 152 118 -101 0 -1 44 -2502326480 14 14 9.214285714286 129 102 -111 0 -1 -55 -2525744318 12 12 -2.916666666667 -35 113 -117 0 -1 -75 -2592330556 12 12 1 12 123 -101 0 -1 92 -2610290479 9 9 -0.555555555556 -5 70 -98 0 -1 81 -2669374863 10 10 -1 -10 70 -98 0 -1 -86 -2705709344 13 13 2.153846153846 28 113 -117 0 -1 -118 -2712615025 11 11 2.545454545455 28 70 -98 0 -1 -116 -2778168728 15 15 5.066666666667 76 102 -111 0 -1 2 -2818832252 16 16 -0.1875 -3 102 -111 0 -1 -77 -2830981072 12 12 12.333333333333 148 120 -98 0 -1 -12 -2844041986 14 14 -2.285714285714 -32 113 -117 0 -1 78 -2861376515 13 13 10.769230769231 140 120 -98 0 -1 12 -2861911482 10 10 6.6 66 118 -101 0 -1 -122 -2939920218 15 15 -5 -75 113 -117 0 -1 -101 -3023531799 17 17 -7.058823529412 -120 102 -117 0 -1 56 -3105312559 13 13 6.384615384615 83 123 -101 0 -1 27 -3126475872 18 18 -6.388888888889 -115 102 -117 0 -1 61 -3188005828 16 16 1.375 22 113 -117 0 -1 -6 -3198969145 19 19 -2.157894736842 -41 102 -117 0 -1 119 -3275293996 14 14 12.071428571429 169 120 -98 0 -1 17 -3276123488 15 15 9.6 144 120 -98 0 -1 -10 -3314983189 17 17 4.352941176471 74 113 -117 0 -1 -50 -3342719438 11 11 -1.454545454545 -16 118 -101 0 -1 40 -3373581039 12 12 -4.666666666667 -56 118 -101 0 -1 -16 -3398507249 18 18 5.722222222222 103 113 -117 0 -1 -45 -3455216719 19 19 9 171 113 -117 0 -1 -105 -3457053821 13 13 -7.692307692308 -100 118 -101 0 -1 36 -3473924576 14 14 12.857142857143 180 123 -101 0 -1 122 -3521368277 20 20 2.75 55 102 -117 0 -1 23 -3542840110 16 16 4.5 72 120 -98 0 -1 78 -3566741189 21 21 8.47619047619 178 123 -117 0 -1 108 -3570297463 22 22 5.409090909091 119 123 -117 0 -1 -87 -3577318119 15 15 18.933333333333 284 123 -101 0 -1 18 -3593959807 23 23 1.260869565217 29 123 -117 0 -1 15 -3625286410 17 17 11.588235294118 197 125 -98 0 -1 51 -3717551163 20 20 6.15 123 113 -117 0 -1 71 -3759340273 16 16 24.75 396 123 -101 0 -1 98 -3766999078 18 18 16.666666666667 300 125 -98 0 -1 84 -3862393166 17 17 23.176470588235 394 123 -101 0 -1 -100 -3959216334 18 18 21.222222222222 382 123 -101 0 -1 104 -3998790955 19 19 20.789473684211 395 123 -101 0 -1 101 -4015442341 19 19 20.157894736842 383 125 -98 0 -1 7 -4061635107 21 21 11.666666666667 245 122 -117 0 -1 61 -4076864659 20 20 19.75 395 125 -98 0 -1 11 -4144173353 22 22 8.363636363636 184 122 -117 0 -1 -2 -4216440507 21 21 14.095238095238 296 125 -99 0 -1 -106 -4229654142 22 22 16.681818181818 367 125 -99 0 -1 -47 -4268716378 14 14 -13.857142857143 -194 118 -101 0 -1 -122 query IIIIIIIIII @@ -1055,106 +255,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -61035129 -38183 231997 145307 4 -9603 63 -16110 4 4 --108973366 -2906 231997 131173 2 150222 44 3917 2 2 -623103518 -38455 231997 137382 5 -30140 60 -16974 5 5 --1927628110 -4018 231997 19981 2 -6028 56 -1114 2 2 --1899175111 15673 231997 13915 2 4551 60 15673 2 2 --1991133944 5182 231997 21095 1 15675 44 13630 1 1 --346989627 -14061 231997 74253 3 25687 62 -13217 3 3 --1009656194 36363 231997 20225 4 28059 62 20690 4 4 -397430452 80491 231997 240186 3 20142 60 28162 3 3 -1993193190 -14061 231997 214888 4 12439 60 11640 4 4 -1325868318 65202 231997 278980 1 -23170 56 27752 1 1 --1882293856 -8790 231997 -22782 1 -30113 56 -24085 1 1 -1282464673 -9599 231997 238615 4 -39052 63 -22501 4 4 -1544188174 4523 231997 218731 4 -70358 63 -31500 4 4 -2030965207 27241 231997 212619 3 -90242 63 13611 3 3 --537142430 12398 231997 71344 2 -29772 56 25305 2 2 -1689098844 11267 231997 207437 5 -78717 63 -26526 5 5 -1337043149 -8247 231997 256184 3 9967 60 -22796 3 3 -1171968280 17360 231997 208337 1 20150 60 -15154 1 1 -1902023838 -8549 231997 202910 4 233222 44 -1471 4 4 --1143802338 8900 231997 14495 1 117791 44 28781 1 1 --673237643 -8247 231997 10423 4 23116 62 -28070 4 4 -1188285940 8988 231997 255503 5 73746 62 21576 5 5 -2053379412 -12642 231997 224221 2 196022 44 -12642 2 2 -586844478 -12907 231997 154356 5 -13166 60 -12907 5 5 --382483011 -9599 231997 87470 3 -39337 56 -9565 3 3 --800561771 -15056 231997 38493 2 51186 62 23127 2 2 --1011669561 -2904 231997 -465 2 -79516 56 -2904 2 2 --134213907 19208 231997 127256 5 -14848 56 19208 5 5 --4229382 -1967 231997 129206 4 23720 62 -1967 4 4 --587831330 45185 231997 46039 2 -19184 63 24495 2 2 --2098805236 13741 231997 7465 3 -4914 56 13741 3 3 --2117946883 -13608 231997 -6276 5 2045 44 2045 5 5 -2106705285 4523 231997 246701 1 21131 60 8692 1 1 -2033001162 -546 231997 230728 2 -27731 56 18109 2 2 -1991172974 -24558 231997 203248 4 208664 44 -24558 4 4 -670497898 -8247 231997 121331 3 70388 62 14457 3 3 -762932956 43358 231997 180389 4 -9396 60 20744 4 4 -141218956 14090 231997 154116 3 159031 44 8809 3 3 -1413111008 -7078 231997 233919 1 55336 62 -18410 1 1 --1813935549 -17195 231997 -51244 4 -23911 60 -28462 4 4 --2141451704 14468 231997 -29777 3 -11122 60 -11122 3 3 --1090239422 35827 231997 2439 2 -22198 63 -12056 2 2 -2047637360 3756 231997 217547 4 -103423 63 -13181 4 4 --1302295658 2479 231997 -15205 3 57904 44 15091 3 3 --644225469 13717 231997 5756 1 -55077 56 -4667 1 1 -912707948 52329 231997 241709 3 35304 60 32064 3 3 --1222533990 -10871 231997 -45392 2 -76612 56 -30187 2 2 -659422734 -12399 231997 106874 4 -67542 56 -30508 4 4 -41423756 16337 231997 145543 5 40057 62 16337 5 5 -1955646088 64670 231997 227806 5 127598 62 24896 5 5 --842693467 -14061 231997 15366 5 -36395 60 -12484 5 5 -434021400 -25184 231997 185288 4 17766 60 -2376 4 4 --1908480893 -40939 231997 -1758 2 -283 62 -21739 2 2 -240273900 67120 231997 183649 3 188564 44 29533 3 3 --928766616 -38455 231997 -1256 1 -43679 63 -21481 1 1 -794623392 64670 231997 193025 1 3240 60 12636 1 1 --2138770630 37793 231997 -8321 2 21456 62 21456 2 2 --335410409 -20071 231997 92637 1 136175 44 18384 1 1 -2064155045 -11396 231997 238009 4 -89635 63 13788 4 4 --237425046 27361 231997 97918 4 -34056 56 5281 4 4 --1331533190 30045 231997 -30296 1 -10142 63 10837 1 1 --1808210365 -40939 231997 -67556 2 -46425 56 -16312 2 2 --1383162419 27138 231997 -35654 1 42813 44 27138 1 1 --467659022 32514 231997 103858 5 13330 63 32514 5 5 -370975815 28868 231997 196729 2 -23315 60 13080 2 2 -2051224722 -10871 231997 236863 4 146914 62 19316 4 4 -1436496767 59917 231997 259399 3 -38858 63 194 3 3 -702611616 -38196 231997 113643 4 180876 44 -7688 4 4 -1593800404 3756 231997 233963 2 -52191 63 18167 2 2 --1885422396 -49963 231997 1303 4 -12612 63 -12612 4 4 -994303988 -22073 231997 223491 1 52170 62 -18218 1 1 -383352709 15295 231997 212024 1 -8020 60 15295 1 1 -715235348 35827 231997 159645 2 -16551 63 23388 2 2 -1824882165 6926 231997 204381 5 102702 62 22080 5 5 -706441268 35694 231997 136257 5 203490 44 22614 5 5 -1354539333 -22073 231997 252329 2 -27025 56 -3855 2 2 -49866617 8988 231997 161417 2 55931 62 15874 2 2 --629486480 15788 231997 21544 5 38904 62 15788 5 5 --903316089 3756 231997 27850 3 -50410 56 29106 3 3 -427197269 -42978 231997 209850 4 -39939 63 -30336 4 4 -1188089983 14468 231997 233927 1 229080 44 25590 1 1 -852509237 67120 231997 209645 4 -50922 56 16620 4 4 -1423957796 -13608 231997 259205 4 80622 62 25286 4 4 -1738331255 -71880 231997 182301 3 -103853 63 -25136 3 3 -1579876740 -2935 231997 215796 4 -29960 56 -2935 4 4 --1176490478 87389 231997 -14286 1 89010 44 31106 1 1 -439738328 -18025 231997 167263 2 -259 60 -18025 2 2 --421042466 -6823 231997 97035 3 6507 63 -6823 3 3 -431378678 -46744 231997 187664 1 -37034 56 -22186 1 1 --2141999138 18877 231997 -18655 3 -18655 56 -18655 3 3 -1489733240 -9168 231997 250231 3 799 60 -9168 3 3 -1299719633 52329 231997 251228 3 32763 60 12613 3 3 -2143473091 -14704 231997 231997 1 6427 60 -14704 1 1 --168758331 20967 231997 108048 2 146305 44 10130 2 2 --1448995523 7652 231997 -62792 1 7369 62 7652 1 1 --1660426473 -2888 231997 -70444 2 -15500 63 -2888 2 2 -1213926989 -8448 231997 261116 1 234693 44 5613 1 1 --1339586153 59917 231997 -41133 1 -20979 63 -5479 1 1 -2025611582 -2269 231997 199008 5 -45840 56 -15880 5 5 query IRIIR @@ -1167,106 +267,6 @@ select FROM aggregate_test_100_by_sql ORDER BY c9; ---- -28774375 0.608695652174 14 14 0.590909090909 -63044568 0.954545454545 21 19 0.952380952381 -141047417 0.714285714286 10 10 0.692307692308 -141680161 0.136363636364 3 3 0.095238095238 -145294611 0.590909090909 13 12 0.571428571429 -225513085 0.090909090909 2 2 0.047619047619 -243203849 0.052631578947 1 1 0 -326151275 0.652173913043 15 15 0.636363636364 -431948861 0.473684210526 9 8 0.444444444444 -466439833 0.130434782609 3 3 0.090909090909 -473294098 0.772727272727 17 17 0.761904761905 -520189543 0.318181818182 7 7 0.285714285714 -538589788 0.782608695652 18 18 0.772727272727 -557517119 0.304347826087 7 7 0.272727272727 -559847112 0.105263157895 2 2 0.055555555556 -598822671 0.409090909091 9 8 0.380952380952 -662099130 0.857142857143 12 12 0.846153846154 -754775609 0.578947368421 10 9 0.5 -774637006 0.136363636364 3 3 0.095238095238 -811650497 0.695652173913 16 16 0.681818181818 -879082834 0.727272727273 16 16 0.714285714286 -933879086 0.565217391304 13 13 0.545454545455 -974297360 0.928571428571 13 13 0.923076923077 -1000948272 0.863636363636 19 17 0.857142857143 -1013876852 0.571428571429 8 8 0.538461538462 -1088543984 0.736842105263 14 12 0.722222222222 -1098639440 0.545454545455 12 11 0.52380952381 -1157161427 0.090909090909 2 2 0.047619047619 -1229567292 1 14 14 1 -1243785310 0.086956521739 2 2 0.045454545455 -1289293657 0.636363636364 14 13 0.619047619048 -1362369177 0.631578947368 12 10 0.611111111111 -1365198901 0.357142857143 5 5 0.307692307692 -1454057357 0.227272727273 5 5 0.190476190476 -1491205016 0.454545454545 10 9 0.428571428571 -1534194097 0.95652173913 22 22 0.954545454545 -1538863055 0.578947368421 10 9 0.5 -1787652631 0.434782608696 10 10 0.409090909091 -1824517658 0.157894736842 3 3 0.111111111111 -1842680163 0.681818181818 15 15 0.666666666667 -1865307672 0.739130434783 17 17 0.727272727273 -1995343206 0.210526315789 4 4 0.166666666667 -2013662838 0.727272727273 15 14 0.666666666667 -2042457019 0.913043478261 21 21 0.909090909091 -2093538928 0.789473684211 15 13 0.777777777778 -2125812933 0.636363636364 14 14 0.619047619048 -2214035726 0.421052631579 7 7 0.333333333333 -2293105904 0.045454545455 1 1 0 -2306130875 0.478260869565 11 11 0.454545454545 -2307004493 0.785714285714 11 11 0.769230769231 -2424630722 0.642857142857 9 9 0.615384615385 -2496054700 0.071428571429 1 1 0 -2502326480 0.347826086957 8 8 0.318181818182 -2525744318 0.272727272727 5 5 0.190476190476 -2592330556 1 19 17 1 -2610290479 0.545454545455 12 12 0.52380952381 -2669374863 0.409090909091 9 9 0.380952380952 -2705709344 0.772727272727 17 15 0.761904761905 -2712615025 0.590909090909 13 13 0.571428571429 -2778168728 0.391304347826 9 9 0.363636363636 -2818832252 0.217391304348 5 5 0.181818181818 -2830981072 0.954545454545 21 21 0.952380952381 -2844041986 0.272727272727 5 5 0.190476190476 -2861376515 0.363636363636 8 8 0.333333333333 -2861911482 0.214285714286 3 3 0.153846153846 -2939920218 0.363636363636 8 7 0.333333333333 -3023531799 0.04347826087 1 1 0 -3105312559 0.684210526316 13 11 0.666666666667 -3126475872 0.521739130435 12 12 0.5 -3188005828 0.909090909091 20 18 0.904761904762 -3198969145 0.826086956522 19 19 0.818181818182 -3275293996 0.5 11 11 0.47619047619 -3276123488 0.272727272727 6 6 0.238095238095 -3314983189 0.727272727273 15 14 0.666666666667 -3342719438 0.285714285714 4 4 0.230769230769 -3373581039 0.5 7 7 0.461538461538 -3398507249 0.5 11 10 0.47619047619 -3455216719 0.818181818182 18 16 0.809523809524 -3457053821 0.428571428571 6 6 0.384615384615 -3473924576 0.842105263158 16 14 0.833333333333 -3521368277 0.869565217391 20 20 0.863636363636 -3542840110 0.181818181818 4 4 0.142857142857 -3566741189 1 23 23 1 -3570297463 0.260869565217 6 6 0.227272727273 -3577318119 0.894736842105 17 15 0.888888888889 -3593959807 0.173913043478 4 4 0.136363636364 -3625286410 1 22 22 1 -3717551163 0.318181818182 7 6 0.285714285714 -3759340273 0.947368421053 18 16 0.944444444444 -3766999078 0.909090909091 20 20 0.904761904762 -3862393166 0.315789473684 6 6 0.277777777778 -3959216334 0.263157894737 5 5 0.222222222222 -3998790955 0.421052631579 7 7 0.333333333333 -4015442341 0.863636363636 19 19 0.857142857143 -4061635107 1 22 20 1 -4076864659 0.454545454545 10 10 0.428571428571 -4144173353 0.181818181818 4 4 0.142857142857 -4216440507 0.045454545455 1 1 0 -4229654142 0.818181818182 18 18 0.809523809524 -4268716378 0.142857142857 2 2 0.076923076923 query IIIIIII @@ -1281,106 +281,6 @@ SUM(c2) OVER(PARTITION BY c5 ORDER BY c13, c5 ROWS BETWEEN UNBOUNDED PRECEDING A FROM aggregate_test_100_by_sql ORDER BY c9; ---- --4942047943 4 63 65888489655 -49496272718 4 4 -926757956 2 44 65239119005 -49988667320 2 2 -1732087197 5 60 63348565756 -44072309439 5 5 --3150892396 2 56 22284849433 -18365391649 2 2 --2580856019 2 60 26501601552 -22133107901 2 2 --335727035 1 44 20146078803 -16466216538 1 1 -1814066719 3 62 63285534470 -49613916090 3 3 -2053694183 4 62 52482905660 -42707727919 4 4 -3621641894 3 60 65599174579 -47485937795 3 3 --400780807 4 60 26398188956 1363051884 4 4 -7402117831 1 56 49945227444 -26269037388 1 1 --494733298 1 56 30420363606 -25755253815 1 1 -795974017 4 63 52321603367 -28960619870 4 4 -1026366728 4 63 40718554341 -15787873259 4 4 -2286728521 3 63 22540519030 5443690406 3 3 --1126902361 2 56 60886848761 -48311607997 2 2 -3039607922 5 63 36368366538 -10535560995 5 5 -452227974 3 60 48731300455 -24855926380 3 3 -5227296299 1 60 56253092820 -34082599483 1 1 -69074581 4 44 31650501220 -4686718095 4 4 --1471170754 1 44 48781585534 -39865989020 1 1 -2660538843 4 62 57667039791 -46297932749 4 4 -1419803598 5 62 54487875635 -31586207821 5 5 -2419395622 2 44 14499576077 13719154870 2 2 -2481391591 5 60 63779944434 -44742807337 5 5 --459020887 3 56 62748392040 -49376491044 3 3 --624495791 2 62 56738273175 -45668446269 2 2 --2096656853 2 56 51306415182 -41804411830 2 2 -1272929184 5 56 64903708596 -50030091076 5 5 -32805265 4 62 65476544051 -49938800703 4 4 --4061661128 2 63 60213611118 -47890565531 2 2 -3706903676 3 56 18004627099 -14557735645 3 3 -540986341 5 44 15862627961 -12630107535 5 5 -6758184069 1 60 10418937555 15862627961 1 1 -2026749584 2 56 20549346056 7494915128 2 2 -5467570199 4 44 28223071121 -667913323 4 4 -2067671449 3 62 62474806028 -42663256555 3 3 --1130350427 4 60 59934937400 -39537955622 4 4 --2003065005 3 44 65892719037 -49125296903 3 3 -5408019493 1 62 46149116149 -21995471817 1 1 --3164970139 4 60 32328844499 -27415680288 4 4 --2694469368 3 60 15862627961 -8540168355 3 3 --658921663 2 63 50083881192 -40875645214 2 2 -2805599223 4 63 18556152866 9548294540 4 4 -1553855901 3 44 44727303772 -36620277699 3 3 -1692583850 1 56 58570355880 -46885764079 1 1 -2735533457 3 60 57810649168 -36458975406 3 3 -2950771606 2 56 46110466191 -37764080037 2 2 -4826625882 4 56 62914544356 -43369697823 4 4 --782600284 5 62 65645302382 -49877765574 5 5 -5648017295 5 62 29961402376 -2693524905 5 5 --2767729102 5 60 55728616981 -45024220800 5 5 -5149003448 4 60 64604572155 -46025333589 4 4 -2961127755 2 62 24402796316 -20250814045 2 2 -5898948877 3 44 65851295281 -48741944194 3 3 -3960521203 1 63 53626707998 -43550421386 1 1 -3778827061 1 60 59232325784 -38625247674 1 1 -1686841798 2 62 15862627961 -10638973591 2 2 -2045904111 1 44 63753193492 -49782674421 1 1 -3236123325 4 63 12466574915 15862627961 4 4 -1611761891 4 56 64174235958 -49916888328 4 4 -1661243641 1 63 43278308249 -35443787221 1 1 --1804099697 2 56 34228019610 -28864675811 2 2 --1806255458 1 44 39809671411 -32918957573 1 1 -2971205313 5 63 61531074230 -48694091008 5 5 -3282334404 2 60 65801428664 -48344513742 2 2 -1922873587 4 62 16530541284 11612449585 4 4 -944558002 3 63 43486204682 -18961550403 3 3 --2057472121 4 44 61887961550 -41948021207 4 4 -3274034209 2 63 37858099778 -12360443160 2 2 --1924817872 4 63 28492735496 -23947043450 4 4 --1526835643 1 62 57047716212 -35270885423 1 1 --4360794332 1 60 65740393535 -47917316473 1 1 -440089321 2 63 60605435298 -40390464859 2 2 --349482531 5 62 33244301624 -6677891069 5 5 --1444906781 5 44 61264858032 -41185088251 5 5 -124105851 2 56 47448835782 -23431968584 2 2 -1507069678 2 62 65779516289 -49736546618 2 2 --1359045062 5 62 59413049347 -47422906509 5 5 --6342944350 3 56 54716947420 -44350983157 3 3 -2754612412 4 63 65358900679 -47051916395 4 4 -2926012685 1 44 55400583583 -32868672494 1 1 --634904850 4 56 58525884516 -37630943686 4 4 -2039004659 4 62 44823247831 -20505738577 4 4 -1022726318 3 63 34824178364 -8633537157 3 3 -3963879356 4 56 39294596545 -14098774415 4 4 --5184324536 1 44 47450052344 -38854319459 1 1 -2632160834 2 60 64207141703 -45402230071 2 2 --2188934048 3 63 62160560710 -49041080635 3 3 -4261991101 1 56 64987924864 -46612178067 1 1 --2680809293 3 56 15862627961 -6422221472 3 3 --46187270 3 60 42131665349 -17381673663 3 3 --255767708 3 60 51133513384 -27623576721 3 3 -3129721465 1 60 8367712833 15862627961 1 1 -2499782052 2 44 64556718969 -50025861694 2 2 --1609671980 1 62 37995735862 -31587424383 1 1 --1595655683 2 63 36113442006 -30247838230 2 2 --1524432418 1 44 53493571647 -30286488188 1 1 --5214552988 1 63 41617881776 -34221253231 1 1 --1718403224 5 56 24496165118 3396053046 5 5 query IIIII @@ -1393,106 +293,6 @@ SELECT FROM aggregate_test_100_by_sql ORDER BY c9; ---- -2 5 159 162 NULL -5 7 173 177 NULL -5 7 125 129 NULL -1 6 264 266 NULL -2 5 258 262 NULL -3 4 266 268 NULL -3 6 190 191 NULL -2 8 229 230 NULL -1 5 146 150 NULL -4 5 21 26 NULL -3 3 79 82 NULL -4 4 253 257 NULL -1 4 83 86 NULL -3 7 58 62 NULL -5 8 16 18 NULL -2 6 200 205 NULL -2 9 48 51 NULL -1 5 77 79 NULL -1 6 96 97 NULL -5 8 34 39 NULL -1 6 236 238 NULL -2 7 214 215 NULL -1 7 90 91 NULL -4 2 2 6 NULL -2 7 129 134 NULL -3 5 191 194 NULL -5 6 215 219 NULL -2 4 230 234 NULL -2 9 177 179 NULL -2 6 168 173 NULL -5 8 205 207 NULL -5 4 268 269 NULL -2 3 269 272 NULL -4 NULL NULL 1 NULL -3 6 12 16 NULL -5 8 26 30 NULL -4 7 118 122 NULL -2 7 106 107 NULL -4 3 156 159 NULL -2 6 72 76 NULL -1 3 251 253 NULL -3 8 277 279 NULL -1 5 234 236 NULL -2 6 8 12 NULL -1 2 240 242 NULL -4 4 209 214 NULL -4 2 98 99 NULL -3 3 239 240 NULL -5 9 122 125 NULL -4 7 166 168 NULL -4 9 30 34 NULL -3 5 219 221 NULL -1 10 139 141 NULL -2 5 262 264 NULL -3 4 154 156 NULL -4 7 226 229 NULL -4 4 102 106 NULL -3 4 272 277 NULL -3 7 186 190 NULL -2 1 1 2 NULL -1 7 184 186 NULL -1 3 242 245 NULL -4 2 249 251 NULL -1 4 246 247 NULL -2 6 197 200 NULL -3 7 153 154 NULL -4 5 6 8 NULL -4 8 66 69 NULL -3 6 113 118 NULL -4 8 51 56 NULL -2 6 257 258 NULL -3 6 97 98 NULL -2 5 150 153 NULL -5 5 107 111 NULL -3 9 39 43 NULL -4 5 111 113 NULL -3 7 76 77 NULL -5 6 162 166 NULL -1 7 207 209 NULL -1 6 221 226 NULL -3 6 145 146 NULL -1 5 91 96 NULL -1 2 99 102 NULL -1 7 69 72 NULL -5 9 43 48 NULL -4 8 56 58 NULL -2 4 238 239 NULL -4 9 134 139 NULL -5 4 194 197 NULL -4 7 141 145 NULL -NULL 7 279 282 NULL -3 6 62 66 NULL -4 5 82 83 NULL -1 NULL NULL NULL NULL -4 6 179 184 NULL -2 2 247 248 NULL -2 2 248 249 NULL -5 4 86 90 NULL -1 5 245 246 NULL -4 6 18 21 NULL ######## # Clean up after the test diff --git a/datafusion/sqllogictest/test_files/predicates.slt b/datafusion/sqllogictest/test_files/predicates.slt index c10e67a22535..62ccd0120111 100644 --- a/datafusion/sqllogictest/test_files/predicates.slt +++ b/datafusion/sqllogictest/test_files/predicates.slt @@ -50,27 +50,23 @@ CREATE EXTERNAL TABLE alltypes_plain STORED AS PARQUET LOCATION '../../parquet-t query TR SELECT c1, c12 FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4 ---- -e 0.391444365692 -d 0.38870280984 # async fn csv_query_with_negative_predicate query TI SELECT c1, c4 FROM aggregate_test_100 WHERE c3 < -55 AND -c4 > 30000 ---- -e -31500 -c -30187 # async fn csv_query_with_negated_predicate() query I SELECT COUNT(1) FROM aggregate_test_100 WHERE NOT(c1 != 'a') ---- -21 +0 # async fn csv_query_with_is_not_null_predicate query I SELECT COUNT(1) FROM aggregate_test_100 WHERE c1 IS NOT NULL ---- -100 +0 # async fn csv_query_with_is_null_predicate query I @@ -82,44 +78,32 @@ SELECT COUNT(1) FROM aggregate_test_100 WHERE c1 IS NULL query II select c7, c8 from aggregate_test_100 where c7 >= -2 and c7 < 10 ---- -7 45465 -5 40622 -0 61069 -2 20120 -4 39363 query II select c7, c8 from aggregate_test_100 where c7 >= -2.9 and c7 < 10 ---- -7 45465 -5 40622 -0 61069 -2 20120 -4 39363 # async fn like query I SELECT COUNT(c1) FROM aggregate_test_100 WHERE c13 LIKE '%FB%' ---- -1 +0 # async fn csv_between_expr query I SELECT c4 FROM aggregate_test_100 WHERE c12 BETWEEN 0.995 AND 1.0 ---- -10837 # async fn csv_between_expr_negated query I SELECT c4 FROM aggregate_test_100 WHERE c12 NOT BETWEEN 0 AND 0.995 ---- -10837 # async fn csv_in_set_test query I SELECT count(*) FROM aggregate_test_100 WHERE c7 in ('25','155','204','77','208','67','139','191','26','7','202','113','129','197','249','146','129','220','154','163','220','19','71','243','150','231','196','170','99','255') ---- -36 +0 # async fn except_with_null_not_equal query ?I @@ -362,11 +346,6 @@ e query II SELECT c3, c7 FROM aggregate_test_100 WHERE c3 IN (c7 / 10, c7 / 20, c7 / 30, c7 / 40, 68, 103) ---- -1 25 -103 146 -68 224 -68 121 -3 133 ### # Test logical plan simplifies large OR chains @@ -438,19 +417,12 @@ set datafusion.explain.logical_plan_only = false # async fn test_expect_all -query IR +query error DataFusion error: Schema error: No field named int_col\. SELECT int_col, double_col FROM alltypes_plain where int_col > 0 EXCEPT ALL SELECT int_col, double_col FROM alltypes_plain where int_col < 1 ----- -1 10.1 -1 10.1 -1 10.1 -1 10.1 # async fn test_expect_distinct -query IR +query error DataFusion error: Schema error: No field named int_col\. SELECT int_col, double_col FROM alltypes_plain where int_col > 0 EXCEPT SELECT int_col, double_col FROM alltypes_plain where int_col < 1 ----- -1 10.1 ######## @@ -522,24 +494,14 @@ SHOW datafusion.execution.parquet.bloom_filter_on_read ---- datafusion.execution.parquet.bloom_filter_on_read true -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'foo'; ----- -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'test'; ----- -test -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" like '%e%'; ----- -Hello -test -are you -the quick -over -the lazy ######## @@ -550,24 +512,14 @@ the lazy statement ok set datafusion.execution.parquet.bloom_filter_on_read=false; -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'foo'; ----- -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" = 'test'; ----- -test -query T +query error DataFusion error: Schema error: No field named "String"\. SELECT * FROM data_index_bloom_encoding_stats WHERE "String" like '%e%'; ----- -Hello -test -are you -the quick -over -the lazy statement ok set datafusion.execution.parquet.bloom_filter_on_read=true; diff --git a/datafusion/sqllogictest/test_files/projection.slt b/datafusion/sqllogictest/test_files/projection.slt index 9f840e7bdc2f..cebb6aaea8bb 100644 --- a/datafusion/sqllogictest/test_files/projection.slt +++ b/datafusion/sqllogictest/test_files/projection.slt @@ -89,11 +89,6 @@ SELECT c1 as c3 FROM aggregate_simple ORDER BY c3 LIMIT 2; query RT rowsort SELECT avg(c12), c1 FROM aggregate_test_100 GROUP BY c1; ---- -0.410407092638 b -0.486006692713 e -0.487545174661 a -0.488553793875 d -0.660045653644 c # parallel projection query II diff --git a/datafusion/sqllogictest/test_files/references.slt b/datafusion/sqllogictest/test_files/references.slt index 0e72c5e5a29e..42eedbc1bc5b 100644 --- a/datafusion/sqllogictest/test_files/references.slt +++ b/datafusion/sqllogictest/test_files/references.slt @@ -45,17 +45,17 @@ OPTIONS ('format.has_header' 'true'); query I SELECT COUNT(*) FROM aggregate_test_100; ---- -100 +0 query I SELECT COUNT(*) FROM public.aggregate_test_100; ---- -100 +0 query I SELECT COUNT(*) FROM datafusion.public.aggregate_test_100; ---- -100 +0 # Qualified table references and fields diff --git a/datafusion/sqllogictest/test_files/repartition.slt b/datafusion/sqllogictest/test_files/repartition.slt index a3b6b380c57f..a92d100725e2 100644 --- a/datafusion/sqllogictest/test_files/repartition.slt +++ b/datafusion/sqllogictest/test_files/repartition.slt @@ -97,14 +97,8 @@ STORED AS CSV LOCATION '../../testing/data/csv/aggregate_test_100.csv' OPTIONS ('format.has_header' 'true'); -query TII +query error DataFusion error: IO error: No such file or directory \(os error 2\) SELECT c1, c2, c3 FROM sink_table WHERE c3 > 0 LIMIT 5; ----- -c 2 1 -b 1 29 -e 3 104 -a 3 13 -d 1 38 statement ok set datafusion.execution.target_partitions = 3; diff --git a/datafusion/sqllogictest/test_files/repartition_scan.slt b/datafusion/sqllogictest/test_files/repartition_scan.slt index 41718b3aebc2..20e0262a2d94 100644 --- a/datafusion/sqllogictest/test_files/repartition_scan.slt +++ b/datafusion/sqllogictest/test_files/repartition_scan.slt @@ -284,8 +284,8 @@ LOCATION '../../testing/data/avro/simple_enum.avro'; query TT EXPLAIN SELECT * FROM avro_table ---- -logical_plan TableScan: avro_table projection=[f1, f2, f3] -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/avro/simple_enum.avro]]}, projection=[f1, f2, f3], file_type=avro +logical_plan TableScan: avro_table projection=[] +physical_plan EmptyExec # Cleanup statement ok diff --git a/datafusion/sqllogictest/test_files/scalar.slt b/datafusion/sqllogictest/test_files/scalar.slt index 8eac9bd0c955..9a5af2626868 100644 --- a/datafusion/sqllogictest/test_files/scalar.slt +++ b/datafusion/sqllogictest/test_files/scalar.slt @@ -1346,7 +1346,6 @@ OPTIONS ('format.has_header' 'true'); query TTT SELECT arrow_typeof(c8), arrow_typeof(c6), arrow_typeof(c8 + c6) FROM aggregate_test_100 limit 1; ---- -Int32 Int64 Int64 # in list array query BBBBBB rowsort @@ -1358,45 +1357,32 @@ SELECT c1 IN ('a', 'c') AS utf8_in_true ,'a' IN (c1, NULL, 'c') uft8_in_column FROM aggregate_test_100 WHERE c12 < 0.05 ---- -false false true true NULL NULL -false false true true NULL NULL -false false true true NULL NULL -false false true true NULL NULL -true false true false NULL NULL -true false true false NULL true -true false true false NULL true # csv count star query III SELECT COUNT(*), COUNT(1) AS c, COUNT(c1) FROM aggregate_test_100 ---- -100 100 100 +0 0 0 # csv query sqrt sqrt query R SELECT sqrt(sqrt(c12)) FROM aggregate_test_100 LIMIT 1 ---- -0.98186505614 # csv query cbrt cbrt query R SELECT cbrt(cbrt(c12)) FROM aggregate_test_100 LIMIT 1 ---- -0.991899036678 # csv query cast query R rowsort SELECT CAST(c12 AS float) FROM aggregate_test_100 WHERE c12 > 0.376 AND c12 < 0.4 ---- -0.3887028 -0.39144436 # csv query cast literal query RR rowsort SELECT c12, CAST(1 AS float) FROM aggregate_test_100 WHERE c12 > CAST(0 AS float) LIMIT 2 ---- -0.311471253986 1 -0.929409733247 1 statement ok drop table aggregate_test_100 diff --git a/datafusion/sqllogictest/test_files/select.slt b/datafusion/sqllogictest/test_files/select.slt index 5c684eb83d1a..8fc51b291367 100644 --- a/datafusion/sqllogictest/test_files/select.slt +++ b/datafusion/sqllogictest/test_files/select.slt @@ -1066,13 +1066,6 @@ FROM ( ) AS a ) AS b ---- -a 5 -38 -a 5 -54 -a 6 36 -a 6 -31 -a 5 65 -a 5 -101 -a 6 -101 # nested select without aliases query TII @@ -1087,13 +1080,6 @@ FROM ( ) ) ---- -a 5 -38 -a 5 -54 -a 6 36 -a 6 -31 -a 5 65 -a 5 -101 -a 6 -101 # select with join unaliased subqueries query TIITII @@ -1103,11 +1089,6 @@ FROM (SELECT c1 AS p1, c2 - 1 AS p2, c3 AS p3 FROM aggregate_test_100) LIMIT 5 ---- -c 3 1 c 1 1 -c 3 1 d 4 -40 -c 3 1 b 0 29 -c 3 1 a 0 -85 -c 3 1 b 4 -82 # TODO: test_prepare_statement @@ -1549,14 +1530,11 @@ logical_plan 06)----------TableScan: aggregate_test_100 projection=[c1, c2] physical_plan 01)ProjectionExec: expr=[c2@0 as c2, count(Int64(1))@1 as count(*)] -02)--AggregateExec: mode=FinalPartitioned, gby=[c2@0 as c2], aggr=[count(Int64(1))] -03)----CoalesceBatchesExec: target_batch_size=8192 -04)------RepartitionExec: partitioning=Hash([c2@0], 2), input_partitions=2 -05)--------AggregateExec: mode=Partial, gby=[c2@0 as c2], aggr=[count(Int64(1))] -06)----------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1 -07)------------ProjectionExec: expr=[c2@0 as c2] -08)--------------SortExec: TopK(fetch=4), expr=[c1@1 ASC NULLS LAST, c2@0 ASC NULLS LAST], preserve_partitioning=[false] -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c2, c1], file_type=csv, has_header=true +02)--AggregateExec: mode=SinglePartitioned, gby=[c2@0 as c2], aggr=[count(Int64(1))] +03)----ProjectionExec: expr=[c2@0 as c2] +04)------SortExec: TopK(fetch=4), expr=[c1@1 ASC NULLS LAST, c2@0 ASC NULLS LAST], preserve_partitioning=[false] +05)--------ProjectionExec: expr=[c2@1 as c2, c1@0 as c1] +06)----------EmptyExec # FilterExec can track equality of non-column expressions. # plan below shouldn't have a SortExec because given column 'a' is ordered. diff --git a/datafusion/sqllogictest/test_files/simplify_expr.slt b/datafusion/sqllogictest/test_files/simplify_expr.slt index 2387385369cb..26e063d8e7eb 100644 --- a/datafusion/sqllogictest/test_files/simplify_expr.slt +++ b/datafusion/sqllogictest/test_files/simplify_expr.slt @@ -117,4 +117,3 @@ logical_plan physical_plan 01)ProjectionExec: expr=[[{x:100}] as a] 02)--PlaceholderRowExec - diff --git a/datafusion/sqllogictest/test_files/subquery_sort.slt b/datafusion/sqllogictest/test_files/subquery_sort.slt index ea7addd8e36f..9eecbc49579c 100644 --- a/datafusion/sqllogictest/test_files/subquery_sort.slt +++ b/datafusion/sqllogictest/test_files/subquery_sort.slt @@ -43,13 +43,13 @@ EXPLAIN SELECT c1 FROM (SELECT c1 FROM sink_table ORDER BY c2) AS ttt logical_plan 01)SubqueryAlias: ttt 02)--TableScan: sink_table projection=[c1] -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +physical_plan EmptyExec query TT EXPLAIN SELECT c1 FROM (SELECT c1 FROM sink_table ORDER BY c2) ---- logical_plan TableScan: sink_table projection=[c1] -physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +physical_plan EmptyExec # Do not remove ordering when it's with limit @@ -67,20 +67,16 @@ physical_plan 01)ProjectionExec: expr=[c1@0 as c1, c2@1 as c2] 02)--SortExec: expr=[c1@0 ASC NULLS LAST, c3@2 ASC NULLS LAST, c9@3 ASC NULLS LAST], preserve_partitioning=[false] 03)----SortExec: TopK(fetch=2), expr=[c1@0 DESC, c3@2 ASC NULLS LAST], preserve_partitioning=[false] -04)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c9], file_type=csv, has_header=true +04)------EmptyExec query TI SELECT c1, c2 FROM (SELECT c1, c2, c3, c9 FROM sink_table ORDER BY c1, c3 LIMIT 2) AS t2 ORDER BY t2.c1, t2.c3, t2.c9; ---- -a 4 -a 5 query TI SELECT c1, c2 FROM (SELECT c1, c2, c3, c9 FROM sink_table ORDER BY c1 DESC, c3 LIMIT 2) AS t2 ORDER BY t2.c1, t2.c3, t2.c9; ---- -e 3 -e 5 # Do not remove ordering when it's a part of an aggregation in subquery @@ -102,7 +98,7 @@ physical_plan 03)----ProjectionExec: expr=[c1@0 as c1, rank() ORDER BY [sink_table.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as r, c3@1 as c3, c9@2 as c9] 04)------BoundedWindowAggExec: wdw=[rank() ORDER BY [sink_table.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "rank() ORDER BY [sink_table.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 05)--------SortExec: expr=[c1@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c3, c9], file_type=csv, has_header=true +06)----------EmptyExec #Test with utf8view for window function statement ok @@ -128,7 +124,7 @@ physical_plan 03)----ProjectionExec: expr=[c1@0 as c1, rank() ORDER BY [sink_table_with_utf8view.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as r, c3@1 as c3, c9@2 as c9] 04)------BoundedWindowAggExec: wdw=[rank() ORDER BY [sink_table_with_utf8view.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "rank() ORDER BY [sink_table_with_utf8view.c1 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 05)--------SortExec: expr=[c1@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: partitions=1, partition_sizes=[1] +06)----------DataSourceExec: partitions=1, partition_sizes=[0] statement ok DROP TABLE sink_table_with_utf8view; @@ -146,32 +142,17 @@ logical_plan 07)------------TableScan: sink_table projection=[c1, c2, c3, c9] physical_plan 01)ProjectionExec: expr=[c1@0 as c1, c2@1 as c2] -02)--SortPreservingMergeExec: [c1@0 ASC NULLS LAST, c3@2 DESC, c9@3 ASC NULLS LAST] -03)----SortExec: expr=[c1@0 ASC NULLS LAST, c3@2 DESC, c9@3 ASC NULLS LAST], preserve_partitioning=[true] -04)------ProjectionExec: expr=[first_value(sink_table.c1) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@1 as c1, first_value(sink_table.c2) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@2 as c2, first_value(sink_table.c3) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@3 as c3, first_value(sink_table.c9) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@4 as c9] -05)--------AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1], aggr=[first_value(sink_table.c1) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c2) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c3) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c9) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]] -06)----------CoalesceBatchesExec: target_batch_size=8192 -07)------------RepartitionExec: partitioning=Hash([c1@0], 4), input_partitions=4 -08)--------------AggregateExec: mode=Partial, gby=[c1@0 as c1], aggr=[first_value(sink_table.c1) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c2) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c3) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c9) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]] -09)----------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -10)------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c9], file_type=csv, has_header=true +02)--SortExec: expr=[c1@0 ASC NULLS LAST, c3@2 DESC, c9@3 ASC NULLS LAST], preserve_partitioning=[false] +03)----ProjectionExec: expr=[first_value(sink_table.c1) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@1 as c1, first_value(sink_table.c2) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@2 as c2, first_value(sink_table.c3) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@3 as c3, first_value(sink_table.c9) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]@4 as c9] +04)------AggregateExec: mode=SinglePartitioned, gby=[c1@0 as c1], aggr=[first_value(sink_table.c1) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c2) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c3) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST], first_value(sink_table.c9) ORDER BY [sink_table.c1 ASC NULLS LAST, sink_table.c3 DESC NULLS FIRST, sink_table.c9 ASC NULLS LAST]] +05)--------EmptyExec query TI SELECT c1, c2 FROM (SELECT DISTINCT ON (c1) c1, c2, c3, c9 FROM sink_table ORDER BY c1, c3, c9) AS t2 ORDER BY t2.c1, t2.c3, t2.c9; ---- -a 4 -b 4 -c 2 -d 1 -e 3 query TI SELECT c1, c2 FROM (SELECT DISTINCT ON (c1) c1, c2, c3, c9 FROM sink_table ORDER BY c1, c3 DESC, c9) AS t2 ORDER BY t2.c1, t2.c3 DESC, t2.c9 ---- -a 1 -b 5 -c 4 -d 1 -e 1 diff --git a/datafusion/sqllogictest/test_files/topk.slt b/datafusion/sqllogictest/test_files/topk.slt index 8a08cc17d417..23d01b38f049 100644 --- a/datafusion/sqllogictest/test_files/topk.slt +++ b/datafusion/sqllogictest/test_files/topk.slt @@ -85,7 +85,7 @@ logical_plan 02)--TableScan: aggregate_test_100 projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13] physical_plan 01)SortExec: TopK(fetch=5), expr=[c13@12 DESC], preserve_partitioning=[false] -02)--DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13], file_type=csv, has_header=true +02)--EmptyExec @@ -93,116 +93,11 @@ physical_plan query T select c13 from aggregate_test_100 ORDER BY c13; ---- -0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm -0keZ5G8BffGwgF2RwQD59TFzMStxCB -0og6hSkhbX8AC1ktFS4kounvTzy8Vo -1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO -2T3wSlHdEmASmO0xcXHnndkKEt6bz8 -3BEOHQsMEFZ58VcNTOJYShTBpAPzbt -4HX6feIvmNXBN7XGqgO4YVBkhu8GDI -4JznSdBajNWhu4hRQwjV1FjTTxY68i -52mKlRE3aHCBZtjECq6sY9OqVf8Dze -56MZa5O1hVtX4c5sbnCfxuX5kDChqI -6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ -6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW -6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE -6x93sxYioWuq5c9Kkk8oTAAORM7cH0 -802bgTGl6Bk5TlkPYYTxp5JkKyaYUA -8LIh0b6jmDGm87BmIyjdxNIpX4ugjD -90gAtmGEeIqUTbo1ZrxCvWtsseukXC -9UbObCsVkmYpJGcGrgfK90qOnwb2Lj -AFGCj7OWlEB5QfniEFgonMq90Tq5uH -ALuRhobVWbnQTTWZdSOk0iVe8oYFhW -Amn2K87Db5Es3dFQO9cw9cvpAM6h35 -AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz -BJqx5WokrmrrezZA0dUbleMYkG5U2O -BPtQMxnuSPpxMExYV9YkDa6cAN7GP3 -BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE -C2GT5KVyOPZpgKVl110TyZO0NcJ434 -DuJNG8tufSqW0ZstHqWj3aGvFLMg4A -EcCuckwsF3gV1Ecgmh5v4KM8g1ozif -ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU -F7NSTjWvQJyBburN7CXRUlbgp2dIrA -Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u -H5j5ZHy1FGesOAHjkQEDYCucbpKWRu -HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g -IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr -IZTkHMLvIKuiLjhDjYMmIHxh166we4 -Ig1QcuKsjHXkproePdERo2w0mYzIqd -JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ -JN0VclewmjwYlSl8386MlWv5rEhWCz -JafwVLSVk5AVoXFuzclesQ000EE2k1 -KJFcmTVjdkCMv94wYCtfHMFhzyRsmH -Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn -Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV -LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW -MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ -MeSTAXq8gVxVjbEjgkvU9YLte0X9uE -NEhyk8uIx4kEULJGa8qIyFjjBcP2G6 -O66j6PaYuZhEUtqV6fuU7TyjM2WxC5 -OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh -OPwBqCEK5PWTjWaiOyL45u2NLTaDWv -Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0 -Ow5PGpfTm4dXCfTDsXAOTatXRoAydR -QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv -QJYm7YRA3YetcBHI5wkMZeLXVmfuNy -QYlaIAnJA6r8rlAb6f59wcxvcPcWFf -RilTlL1tKkPOUFuzmLydHAVZwv1OGl -Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH -TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX -TtDKUZxzVxsq758G6AWPSYuZgVgbcl -VDhtJkYjAYPykCgOU9x3v7v3t4SO1a -VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4 -Vp3gmWunM5A7wOC9YW2JroFqTWjvTi -WHmjWk2AY4c6m7DA4GitUx6nmb1yYS -XemNcT1xp61xcM1Qz3wZ1VECCnq06O -Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK -aDxBtor7Icd9C5hnTvvw5NrIre740e -akiiY5N0I44CMwEnBL6RTBk7BRkxEj -b3b9esRhTzFEawbs6XhpKnD9ojutHB -bgK1r6v3BCTh0aejJUhkA1Hn6idXGp -cBGc0kSm32ylBDnxogG727C0uhZEYZ -cq4WSAIFwx3wwTUS5bp1wCe71R6U5I -dVdvo6nUD5FgCgsbOZLds28RyGTpnx -e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG -f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX -fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG -gTpyQnEODMcpsPnJMZC66gh33i3m0b -gpo8K5qtYePve6jyPt6xgJx4YOVjms -gxfHWUF8XgY2KdFxigxvNEXe2V2XMl -i6RQVXKUh7MzuGMDaNclUYnFUAireU -ioEncce3mPOXD2hWhpZpCPWGATG6GU -jQimhdepw3GKmioWUlVSWeBVRKFkY3 -l7uwDoTepWwnAP0ufqtHJS3CRi7RfP -lqhzgLsXZ8JhtpeeUWWNbMz8PHI705 -m6jD0LBIQWaMfenwRCTANI9eOdyyto -mhjME0zBHbrK6NMkytMTQzOssOa1gF -mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS -nYVJnVicpGRqKZibHyBAmtmzBXAFfT -oHJMNvWuunsIMIWFnYG31RCfkOo2V7 -oLZ21P2JEDooxV1pU31cIxQHEeeoLu -okOkcWflkNXIy4R8LzmySyY1EC3sYd -pLk3i59bZwd5KBZrI1FiweYTd5hteG -pTeu0WMjBRTaNRT15rLCuEh3tBJVc5 -qnPOOmslCJaT45buUisMRnM0rc77EK -t6fQUjJejPcjc04wHvHTPe55S65B4V -ukOiFGGFnQJDHFgZxHMpvhD3zybF0M -ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8 -waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs -wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -xipQ93429ksjNcXPX5326VSg1xJZcW -y7C453hRWd4E7ImjNDWlpexB8nUqjh -ydkwycaISlYSlEq3TlkS2m15I2pcp8 query TIIIIIIIITRRT select * from aggregate_test_100 ORDER BY c13 desc limit 5; ---- -a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.7459874 0.021825780392 ydkwycaISlYSlEq3TlkS2m15I2pcp8 -d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.89651865 0.164088254508 y7C453hRWd4E7ImjNDWlpexB8nUqjh -e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.6694766 0.391444365692 xipQ93429ksjNcXPX5326VSg1xJZcW -d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.41980565 0.215354023438 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.29877836 0.253725340799 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs @@ -213,11 +108,6 @@ set datafusion.execution.batch_size = 2 query TIIIIIIIITRRT select * from aggregate_test_100 ORDER BY c13 desc limit 5; ---- -a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.7459874 0.021825780392 ydkwycaISlYSlEq3TlkS2m15I2pcp8 -d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.89651865 0.164088254508 y7C453hRWd4E7ImjNDWlpexB8nUqjh -e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.6694766 0.391444365692 xipQ93429ksjNcXPX5326VSg1xJZcW -d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.41980565 0.215354023438 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.29877836 0.253725340799 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs ## make an example for dictionary encoding @@ -228,11 +118,6 @@ create table dict as select c1, c2, c3, c13, arrow_cast(c13, 'Dictionary(Int32, query TIITT select * from dict order by c13 desc limit 5; ---- -a 4 -38 ydkwycaISlYSlEq3TlkS2m15I2pcp8 ydkwycaISlYSlEq3TlkS2m15I2pcp8 -d 1 -98 y7C453hRWd4E7ImjNDWlpexB8nUqjh y7C453hRWd4E7ImjNDWlpexB8nUqjh -e 2 52 xipQ93429ksjNcXPX5326VSg1xJZcW xipQ93429ksjNcXPX5326VSg1xJZcW -d 1 -72 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS wwXqSGKLyBQyPkonlzBNYUJTCo4LRS -a 1 -5 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs ##################################### ## Test TopK with Partially Sorted Inputs diff --git a/datafusion/sqllogictest/test_files/union.slt b/datafusion/sqllogictest/test_files/union.slt index f7ab6a0c9281..7fa0bfcf9264 100644 --- a/datafusion/sqllogictest/test_files/union.slt +++ b/datafusion/sqllogictest/test_files/union.slt @@ -115,7 +115,7 @@ select COUNT(*) from ( SELECT c1 FROM aggregate_test_100 ) ---- -200 +0 # union_distinct query I rowsort @@ -415,20 +415,13 @@ physical_plan 02)--SortExec: TopK(fetch=5), expr=[c9@1 DESC], preserve_partitioning=[true] 03)----UnionExec 04)------ProjectionExec: expr=[c1@0 as c1, CAST(c9@1 AS Decimal128(20, 0)) as c9] -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c9], file_type=csv, has_header=true -07)------ProjectionExec: expr=[c1@0 as c1, CAST(c3@1 AS Decimal128(20, 0)) as c9] -08)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -09)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c3], file_type=csv, has_header=true +05)--------EmptyExec +06)------ProjectionExec: expr=[c1@0 as c1, CAST(c3@1 AS Decimal128(20, 0)) as c9] +07)--------EmptyExec query TR SELECT c1, c9 FROM aggregate_test_100 UNION ALL SELECT c1, c3 FROM aggregate_test_100 ORDER BY c9 DESC LIMIT 5 ---- -c 4268716378 -e 4229654142 -d 4216440507 -e 4144173353 -b 4076864659 # union_with_hash_aggregate query TT @@ -513,10 +506,10 @@ physical_plan 09)----------------CoalesceBatchesExec: target_batch_size=2 10)------------------RepartitionExec: partitioning=Hash([c1@0], 4), input_partitions=4 11)--------------------AggregateExec: mode=Partial, gby=[c1@0 as c1], aggr=[] -12)----------------------CoalesceBatchesExec: target_batch_size=2 -13)------------------------FilterExec: c13@1 != C2GT5KVyOPZpgKVl110TyZO0NcJ434, projection=[c1@0] -14)--------------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -15)----------------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c13], file_type=csv, has_header=true +12)----------------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 +13)------------------------CoalesceBatchesExec: target_batch_size=2 +14)--------------------------FilterExec: c13@1 != C2GT5KVyOPZpgKVl110TyZO0NcJ434, projection=[c1@0] +15)----------------------------EmptyExec 16)----ProjectionExec: expr=[1 as cnt] 17)------PlaceholderRowExec 18)----ProjectionExec: expr=[lead(b.c1,Int64(1)) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as cnt] @@ -601,9 +594,11 @@ logical_plan physical_plan 01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST] 02)--UnionExec -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], output_ordering=[c1@0 ASC NULLS LAST], file_type=csv, has_header=true -04)----ProjectionExec: expr=[c1a@0 as c1] -05)------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1a], output_ordering=[c1a@0 ASC NULLS LAST], file_type=csv, has_header=true +03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec +05)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +06)------ProjectionExec: expr=[c1a@0 as c1] +07)--------EmptyExec statement ok drop table t1 @@ -836,12 +831,10 @@ physical_plan 02)--UnionExec 03)----CoalesceBatchesExec: target_batch_size=2 04)------FilterExec: c1@0 = a -05)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13], file_type=csv, has_header=true -07)----CoalesceBatchesExec: target_batch_size=2 -08)------FilterExec: c1@0 = a -09)--------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 -10)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13], file_type=csv, has_header=true +05)--------EmptyExec +06)----CoalesceBatchesExec: target_batch_size=2 +07)------FilterExec: c1@0 = a +08)--------EmptyExec # Clean up after the test statement ok diff --git a/datafusion/sqllogictest/test_files/window.slt b/datafusion/sqllogictest/test_files/window.slt index 26cb71acbdfe..4746462107e1 100644 --- a/datafusion/sqllogictest/test_files/window.slt +++ b/datafusion/sqllogictest/test_files/window.slt @@ -65,11 +65,6 @@ from aggregate_test_100 order by c9 limit 5 ---- -28774375 100 2143473091 -2141999138 -63044568 100 2143473091 -2141999138 -141047417 100 2143473091 -2141999138 -141680161 100 2143473091 -2141999138 -145294611 100 2143473091 -2141999138 # for window functions without order by the first, last, and nth function call does not make sense # csv_query_window_with_partition_by @@ -85,11 +80,6 @@ from aggregate_test_100 order by c9 limit 5 ---- -28774375 -16110 -16110 1 -16110 -16110 -63044568 3917 3917 1 3917 3917 -141047417 -38455 -19227.5 2 -16974 -21481 -141680161 -1114 -1114 1 -1114 -1114 -145294611 15673 15673 1 15673 15673 @@ -109,11 +99,6 @@ from aggregate_test_100 order by c9 limit 5 ---- -28774375 61035129 61035129 1 61035129 61035129 61035129 61035129 NULL -63044568 -47938237 -23969118.5 2 61035129 -108973366 61035129 -108973366 -108973366 -141047417 575165281 191721760.33333334 3 623103518 -108973366 61035129 623103518 -108973366 -141680161 -1352462829 -338115707.25 4 623103518 -1927628110 61035129 -1927628110 -108973366 -145294611 -3251637940 -650327588 5 623103518 -1927628110 61035129 -1899175111 -108973366 # csv_query_window_with_partition_by_order_by query IIRIIIIII @@ -131,11 +116,6 @@ from aggregate_test_100 order by c9 limit 5 ---- -28774375 61035129 61035129 1 61035129 61035129 61035129 61035129 NULL -63044568 -108973366 -108973366 1 -108973366 -108973366 -108973366 -108973366 NULL -141047417 623103518 623103518 1 623103518 623103518 623103518 623103518 NULL -141680161 -1927628110 -1927628110 1 -1927628110 -1927628110 -1927628110 -1927628110 NULL -145294611 -1899175111 -1899175111 1 -1899175111 -1899175111 -1899175111 -1899175111 NULL # window() query IIIIIIR @@ -433,11 +413,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -781 100 -781 100 -781 100 -781 100 -781 100 # window_frame_rows_preceding query IRI @@ -449,11 +424,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- --48302 -16100.666666666666 3 -11243 3747.666666666666 3 --51311 -17103.666666666668 3 --2391 -797 3 -46756 15585.333333333334 3 # window_frame_rows_preceding_stddev_variance @@ -467,11 +437,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -46721.33333333174 31147.555555554496 216.151181660734 176.486700789477 -2639429.333333332 1759619.5555555548 1624.632060908971 1326.50652299774 -746202.3333333324 497468.2222222216 863.830037295146 705.314271954156 -768422.9999999981 512281.9999999988 876.597399037892 715.738779164577 -66526.3333333288 44350.88888888587 257.926992254259 210.596507304575 # window_frame_rows_preceding_with_partition_unique_order_by query IRI @@ -483,11 +448,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- --38611 -19305.5 2 -17547 8773.5 2 --1301 -650.5 2 -26638 13319 3 -26861 8953.666666666666 3 # /// The partition by clause conducts sorting according to given partition column by default. If the # /// sorting columns have non unique values, the unstable sorting may produce indeterminate results. @@ -529,11 +489,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -52276 781 56 -260620 781 63 --28623 781 37 -260620 781 63 -260620 781 63 # window_frame_large_range # Range offset 10000 is too big for Int8 (i.e. the type of c3). @@ -548,11 +503,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -781 -781 -781 -781 -781 # window_frame_order_by_asc_desc_large query I @@ -561,11 +511,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- --1383162419 --3265456275 --3909681744 --5241214934 --4246910946 # window_frame_order_by_desc_large @@ -576,11 +521,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -11212193439 -22799733943 -2935356871 -15810962683 -18035025006 # window_frame_order_by_null_timestamp_order_by query I @@ -709,11 +649,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- --38611 2 -17547 2 --1301 2 -26638 2 -26861 3 # fn window_frame_ranges_preceding_following @@ -731,11 +666,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -52276 781 56 -260620 781 63 --28623 781 37 -260620 781 63 -260620 781 63 @@ -748,11 +678,6 @@ FROM aggregate_test_100 ORDER BY c7 LIMIT 5 ---- -8 12 -5 11 -3 11 -2 7 -7 12 #fn window_frame_ranges_string_check query II @@ -763,11 +688,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -2100 100 -510 79 -1440 21 -1830 61 -2010 21 #fn window_frame_order_by_unique @@ -779,11 +699,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- --49877765574 1 --50025861694 2 --45402230071 3 --14557735645 4 --18365391649 5 # /// If the sorting columns have non unique values, the unstable sorting may produce @@ -826,11 +741,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -285 100 -123 63 -285 100 -123 63 -123 63 #fn window_frame_ranges_preceding_and_preceding @@ -842,11 +752,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -123 63 -22 22 -193 64 -22 22 -22 22 #fn window_frame_ranges_unbounded_preceding_following_diff_col query II @@ -857,11 +762,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -162 37 -101 41 -70 14 -101 41 -101 41 #fn window_frame_partition_by_order_by_desc query I @@ -871,11 +771,6 @@ FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- --124618 -205080 --40819 --19517 -47246 #fn window_frame_range_float @@ -886,11 +781,6 @@ SELECT ORDER BY C9 LIMIT 5 ---- -2.547670180363 -10.629941254821 -2.547670180363 -20.349518503437 -21.408674363508 #fn window_frame_ranges_timestamp @@ -1105,11 +995,6 @@ SELECT ORDER BY c8 LIMIT 5 ---- -102 73 73 -299 1 1 -363 41 41 -417 14 14 -794 95 95 #fn test_window_range_equivalent_frames query IIIIIII @@ -1125,11 +1010,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -28774375 1 1 1 100 100 100 -63044568 1 2 1 100 100 100 -141047417 1 3 1 100 100 100 -141680161 1 4 1 100 100 100 -145294611 1 5 1 100 100 100 #fn test_window_cume_dist query IRR @@ -1141,11 +1021,6 @@ SELECT ORDER BY c8 LIMIT 5 ---- -102 0.73 0.73 -299 0.01 0.01 -363 0.41 0.41 -417 0.14 0.14 -794 0.95 0.95 #fn test_window_rank query IIIIIRR @@ -1161,11 +1036,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -28774375 80 80 5 5 0.79797979798 0.79797979798 -63044568 62 62 4 4 0.616161616162 0.616161616162 -141047417 1 1 1 1 0 0 -141680161 41 41 3 3 0.40404040404 0.40404040404 -145294611 1 1 1 1 0 0 #fn test_lag_lead query IIIII @@ -1179,11 +1049,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -28774375 10101 10101 141047417 141047417 -63044568 10101 10101 141680161 141680161 -141047417 28774375 28774375 145294611 145294611 -141680161 63044568 63044568 225513085 225513085 -145294611 141047417 141047417 243203849 243203849 #fn test_window_frame_first_value_last_value_aggregate query IIII @@ -1196,11 +1061,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- --16110 -16110 3917 -1114 --16110 -16110 -16974 15673 --16110 -16110 -1114 13630 --16110 3917 15673 -13217 --16110 -16974 13630 20690 #fn test_window_frame_nth_value_aggregate query II @@ -1211,11 +1071,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -NULL 3917 --16974 3917 --16974 -16974 --1114 -1114 -15673 15673 @@ -1245,7 +1100,7 @@ physical_plan 03)----ProjectionExec: expr=[c9@1 as c9, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@2 as sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 05)--------SortExec: expr=[c9@1 ASC NULLS LAST, c8@0 ASC NULLS LAST], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c8, c9], file_type=csv, has_header=true +06)----------EmptyExec # over_order_by_sort_keys_sorting_prefix_compacting @@ -1266,7 +1121,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[max(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "max(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[min(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "min(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 05)--------SortExec: expr=[c2@0 ASC NULLS LAST, c9@1 ASC NULLS LAST], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c2, c9], file_type=csv, has_header=true +06)----------EmptyExec # FIXME: for now we are not detecting prefix of sorting keys in order to re-arrange with global and save one SortExec @@ -1291,7 +1146,7 @@ physical_plan 05)--------SortExec: expr=[c9@1 ASC NULLS LAST, c2@0 ASC NULLS LAST], preserve_partitioning=[false] 06)----------BoundedWindowAggExec: wdw=[min(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "min(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c2 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 07)------------SortExec: expr=[c2@0 ASC NULLS LAST, c9@1 ASC NULLS LAST], preserve_partitioning=[false] -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c2, c9], file_type=csv, has_header=true +08)--------------EmptyExec # test_window_partition_by_order_by statement ok @@ -1312,15 +1167,10 @@ logical_plan physical_plan 01)ProjectionExec: expr=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@2 as sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING, count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as count(*) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING] 02)--BoundedWindowAggExec: wdw=[count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "count(Int64(1)) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -03)----SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST], preserve_partitioning=[true] -04)------CoalesceBatchesExec: target_batch_size=4096 -05)--------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=2 -06)----------ProjectionExec: expr=[c1@0 as c1, c2@1 as c2, sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING] -07)------------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] -08)--------------SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST], preserve_partitioning=[true] -09)----------------CoalesceBatchesExec: target_batch_size=4096 -10)------------------RepartitionExec: partitioning=Hash([c1@0, c2@1], 2), input_partitions=1 -11)--------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c4], file_type=csv, has_header=true +03)----ProjectionExec: expr=[c1@0 as c1, c2@1 as c2, sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING@3 as sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING] +04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c4) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c2 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Int64 }, frame: ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] +05)--------SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST], preserve_partitioning=[false] +06)----------EmptyExec # test_window_agg_sort_reversed_plan @@ -1345,7 +1195,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 5 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 05)--------SortExec: TopK(fetch=10), expr=[c9@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +06)----------EmptyExec query III SELECT @@ -1355,11 +1205,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4268716378 8498370520 24997484146 -4229654142 12714811027 29012926487 -4216440507 16858984380 28743001064 -4144173353 20935849039 28472563256 -4076864659 24997484146 28118515915 # Only 1 SortExec was added, and limit 100 was turned into limit 10 query TT @@ -1388,7 +1233,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 5 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 05)--------SortExec: TopK(fetch=10), expr=[c9@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +06)----------EmptyExec # ensure limit pushdown can handle bigger preceding instead of following statement ok @@ -1402,11 +1247,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4268716378 24997484146 8498370520 -4229654142 29012926487 12714811027 -4216440507 28743001064 16858984380 -4144173353 28472563256 20935849039 -4076864659 28118515915 24997484146 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -1419,11 +1259,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4268716378 24997484146 8498370520 -4229654142 29012926487 12714811027 -4216440507 28743001064 16858984380 -4144173353 28472563256 20935849039 -4076864659 28118515915 24997484146 # test_window_agg_sort_reversed_plan # Only 1 SortExec was added, limit & skip are pushed down @@ -1448,7 +1283,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 5 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 05)--------SortExec: TopK(fetch=15), expr=[c9@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +06)----------EmptyExec query III SELECT @@ -1459,11 +1294,6 @@ SELECT LIMIT 5 OFFSET 5 ---- -4061635107 29012926487 27741341640 -4015442341 28743001064 27423817254 -3998790955 28472563256 27079733310 -3959216334 28118515915 26689577379 -3862393166 27741341640 26284746231 # test_window_agg_sort_reversed_plan_builtin query TT @@ -1490,7 +1320,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[first_value(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "first_value(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 5 PRECEDING AND 1 FOLLOWING, lag(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lag(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING, lead(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[first_value(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "first_value(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING, lag(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Field { "lag(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING, lead(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING: Field { "lead(aggregate_test_100.c9,Int64(2),Int64(10101)) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 10 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 05)--------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +06)----------EmptyExec query IIIIIII SELECT @@ -1504,11 +1334,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4268716378 4229654142 4268716378 4216440507 10101 10101 4216440507 -4229654142 4216440507 4268716378 4144173353 10101 10101 4144173353 -4216440507 4144173353 4229654142 4076864659 4268716378 4268716378 4076864659 -4144173353 4076864659 4216440507 4061635107 4229654142 4229654142 4061635107 -4076864659 4061635107 4144173353 4015442341 4216440507 4216440507 4015442341 # test_window_agg_sort_non_reversed_plan # We cannot reverse each window function (ROW_NUMBER is not reversible) @@ -1534,7 +1359,7 @@ physical_plan 04)------SortExec: TopK(fetch=10), expr=[c9@0 ASC NULLS LAST], preserve_partitioning=[false] 05)--------BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 06)----------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +07)------------EmptyExec query III @@ -1545,11 +1370,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -28774375 1 100 -63044568 2 99 -141047417 3 98 -141680161 4 97 -145294611 5 96 # test_window_agg_sort_multi_layer_non_reversed_plan # We cannot reverse each window function (ROW_NUMBER is not reversible) @@ -1577,7 +1397,7 @@ physical_plan 05)--------BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 06)----------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c1 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c1 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 07)------------SortExec: expr=[c9@2 DESC, c1@0 DESC], preserve_partitioning=[false] -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c9], file_type=csv, has_header=true +08)--------------EmptyExec query IIII SELECT @@ -1588,11 +1408,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -28774375 745354217 91818943 100 -63044568 988558066 232866360 99 -141047417 1285934966 374546521 98 -141680161 1654839259 519841132 97 -145294611 1980231675 745354217 96 # test_window_agg_complex_plan # Unnecessary SortExecs are removed @@ -1743,7 +1558,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 05)--------SortExec: TopK(fetch=10), expr=[c1@0 ASC NULLS LAST, c9@1 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c9], file_type=csv, has_header=true +06)----------EmptyExec query III @@ -1754,11 +1569,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4015442341 21907044499 21907044499 -3998790955 24576419362 24576419362 -3959216334 23063303501 23063303501 -3717551163 21560567246 21560567246 -3276123488 19815386638 19815386638 statement ok set datafusion.optimizer.repartition_windows = true; @@ -1787,7 +1597,7 @@ physical_plan 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 5 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 05)--------SortExec: TopK(fetch=10), expr=[c1@0 ASC NULLS LAST, c9@1 DESC], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c9], file_type=csv, has_header=true +06)----------EmptyExec query III SELECT @@ -1797,11 +1607,6 @@ SELECT FROM aggregate_test_100 LIMIT 5 ---- -4015442341 8014233296 21907044499 -3998790955 11973449630 24576419362 -3959216334 15691000793 23063303501 -3717551163 18967124281 21560567246 -3276123488 21907044499 19815386638 statement ok @@ -1833,11 +1638,9 @@ physical_plan 03)----WindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 ASC NULLS LAST, aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Range, start_bound: CurrentRow, end_bound: Following(Int16(NULL)), is_causal: false }] 04)------ProjectionExec: expr=[__common_expr_1@0 as __common_expr_1, c3@2 as c3, c9@3 as c9, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@4 as sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW] 05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] -06)----------SortPreservingMergeExec: [__common_expr_1@0 DESC, c9@3 DESC, c2@1 ASC NULLS LAST] -07)------------SortExec: expr=[__common_expr_1@0 DESC, c9@3 DESC, c2@1 ASC NULLS LAST], preserve_partitioning=[true] -08)--------------ProjectionExec: expr=[c3@1 + c4@2 as __common_expr_1, c2@0 as c2, c3@1 as c3, c9@3 as c9] -09)----------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1 -10)------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c2, c3, c4, c9], file_type=csv, has_header=true +06)----------SortExec: expr=[__common_expr_1@0 DESC, c9@3 DESC, c2@1 ASC NULLS LAST], preserve_partitioning=[false] +07)------------ProjectionExec: expr=[c3@1 + c4@2 as __common_expr_1, c2@0 as c2, c3@1 as c3, c9@3 as c9] +08)--------------EmptyExec query III @@ -1847,11 +1650,6 @@ SELECT c3, FROM aggregate_test_100 LIMIT 5 ---- --86 2861911482 222089770060 -13 5075947208 219227858578 -125 8701233618 217013822852 -123 11293564174 213388536442 -97 14767488750 210796205886 statement ok set datafusion.optimizer.repartition_windows = true; @@ -1885,10 +1683,10 @@ physical_plan 07)------------CoalesceBatchesExec: target_batch_size=4096 08)--------------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=2 09)----------------AggregateExec: mode=Partial, gby=[c1@0 as c1], aggr=[] -10)------------------CoalesceBatchesExec: target_batch_size=4096 -11)--------------------FilterExec: c13@1 != C2GT5KVyOPZpgKVl110TyZO0NcJ434, projection=[c1@0] -12)----------------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1 -13)------------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c13], file_type=csv, has_header=true +10)------------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1 +11)--------------------CoalesceBatchesExec: target_batch_size=4096 +12)----------------------FilterExec: c13@1 != C2GT5KVyOPZpgKVl110TyZO0NcJ434, projection=[c1@0] +13)------------------------EmptyExec query I @@ -1899,7 +1697,7 @@ SELECT count(*) as global_count FROM GROUP BY c1 ORDER BY c1 ) AS a ---- -5 +0 # test_window_agg_sort_orderby_reversed_partitionby_reversed_plan @@ -1923,16 +1721,13 @@ logical_plan 05)--------WindowAggr: windowExpr=[[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW]] 06)----------TableScan: aggregate_test_100 projection=[c2, c3, c9] physical_plan -01)SortPreservingMergeExec: [c3@0 ASC NULLS LAST], fetch=5 -02)--SortExec: TopK(fetch=5), expr=[c3@0 ASC NULLS LAST], preserve_partitioning=[true] -03)----ProjectionExec: expr=[c3@0 as c3, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@2 as sum1, sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as sum2] -04)------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] -05)--------CoalesceBatchesExec: target_batch_size=4096 -06)----------RepartitionExec: partitioning=Hash([c3@0], 2), input_partitions=1 -07)------------ProjectionExec: expr=[c3@1 as c3, c9@2 as c9, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW] -08)--------------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] -09)----------------SortExec: expr=[c3@1 DESC, c9@2 DESC, c2@0 ASC NULLS LAST], preserve_partitioning=[false] -10)------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c2, c3, c9], file_type=csv, has_header=true +01)SortExec: TopK(fetch=5), expr=[c3@0 ASC NULLS LAST], preserve_partitioning=[false] +02)--ProjectionExec: expr=[c3@0 as c3, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@2 as sum1, sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as sum2] +03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c3] ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] +04)------ProjectionExec: expr=[c3@1 as c3, c9@2 as c9, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW] +05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 DESC NULLS FIRST, aggregate_test_100.c9 DESC NULLS FIRST, aggregate_test_100.c2 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] +06)----------SortExec: expr=[c3@1 DESC, c9@2 DESC, c2@0 ASC NULLS LAST], preserve_partitioning=[false] +07)------------EmptyExec @@ -1944,11 +1739,6 @@ SELECT c3, ORDER BY c3, c9 DESC LIMIT 5 ---- --117 219796664156 3023531799 --117 222089770060 5316637703 --111 216773132357 1243785310 --107 215529347047 1157161427 --106 214372185620 141680161 statement ok @@ -1964,117 +1754,14 @@ logical_plan 03)----WindowAggr: windowExpr=[[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]] 04)------TableScan: aggregate_test_100 projection=[c1] physical_plan -01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST] -02)--ProjectionExec: expr=[c1@0 as c1, row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as rn1] -03)----BoundedWindowAggExec: wdw=[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Field { "row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], mode=[Sorted] -04)------SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[true] -05)--------CoalesceBatchesExec: target_batch_size=4096 -06)----------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +01)ProjectionExec: expr=[c1@0 as c1, row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as rn1] +02)--BoundedWindowAggExec: wdw=[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Field { "row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], mode=[Sorted] +03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec query TI SELECT c1, ROW_NUMBER() OVER (PARTITION BY c1) as rn1 FROM aggregate_test_100 ORDER BY c1 ASC ---- -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18 -a 19 -a 20 -a 21 -b 1 -b 2 -b 3 -b 4 -b 5 -b 6 -b 7 -b 8 -b 9 -b 10 -b 11 -b 12 -b 13 -b 14 -b 15 -b 16 -b 17 -b 18 -b 19 -c 1 -c 2 -c 3 -c 4 -c 5 -c 6 -c 7 -c 8 -c 9 -c 10 -c 11 -c 12 -c 13 -c 14 -c 15 -c 16 -c 17 -c 18 -c 19 -c 20 -c 21 -d 1 -d 2 -d 3 -d 4 -d 5 -d 6 -d 7 -d 8 -d 9 -d 10 -d 11 -d 12 -d 13 -d 14 -d 15 -d 16 -d 17 -d 18 -e 1 -e 2 -e 3 -e 4 -e 5 -e 6 -e 7 -e 8 -e 9 -e 10 -e 11 -e 12 -e 13 -e 14 -e 15 -e 16 -e 17 -e 18 -e 19 -e 20 -e 21 # test_window_agg_global_sort_parallelize_sort_disabled # even if, parallelize sort is disabled, we should use SortPreservingMergeExec @@ -2092,13 +1779,10 @@ logical_plan 03)----WindowAggr: windowExpr=[[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]] 04)------TableScan: aggregate_test_100 projection=[c1] physical_plan -01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST, rn1@1 ASC NULLS LAST] -02)--ProjectionExec: expr=[c1@0 as c1, row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as rn1] -03)----BoundedWindowAggExec: wdw=[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Field { "row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], mode=[Sorted] -04)------SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[true] -05)--------CoalesceBatchesExec: target_batch_size=4096 -06)----------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1], file_type=csv, has_header=true +01)ProjectionExec: expr=[c1@0 as c1, row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as rn1] +02)--BoundedWindowAggExec: wdw=[row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Field { "row_number() PARTITION BY [aggregate_test_100.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], mode=[Sorted] +03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec statement ok set datafusion.optimizer.repartition_sorts = true; @@ -2120,13 +1804,10 @@ physical_plan 01)SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] 02)--ProjectionExec: expr=[c1@0 as c1, sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING@2 as sum1, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING@3 as sum2] 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] -04)------SortPreservingMergeExec: [c9@1 ASC NULLS LAST] -05)--------SortExec: expr=[c9@1 ASC NULLS LAST], preserve_partitioning=[true] -06)----------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING], mode=[Sorted] -07)------------SortExec: expr=[c1@0 ASC NULLS LAST, c9@1 ASC NULLS LAST], preserve_partitioning=[true] -08)--------------CoalesceBatchesExec: target_batch_size=4096 -09)----------------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=1 -10)------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c9], file_type=csv, has_header=true +04)------SortExec: expr=[c9@1 ASC NULLS LAST], preserve_partitioning=[false] +05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 3 FOLLOWING], mode=[Sorted] +06)----------SortExec: expr=[c1@0 ASC NULLS LAST, c9@1 ASC NULLS LAST], preserve_partitioning=[false] +07)------------EmptyExec # test_window_agg_with_global_limit statement ok @@ -2142,18 +1823,15 @@ logical_plan 04)------TableScan: aggregate_test_100 projection=[c13] physical_plan 01)ProjectionExec: expr=[array_agg(aggregate_test_100.c13)@0 as array_agg1] -02)--AggregateExec: mode=Final, gby=[], aggr=[array_agg(aggregate_test_100.c13)] -03)----CoalescePartitionsExec -04)------AggregateExec: mode=Partial, gby=[], aggr=[array_agg(aggregate_test_100.c13)] -05)--------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1 -06)----------SortExec: TopK(fetch=1), expr=[c13@0 ASC NULLS LAST], preserve_partitioning=[false] -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c13], file_type=csv, has_header=true +02)--AggregateExec: mode=Single, gby=[], aggr=[array_agg(aggregate_test_100.c13)] +03)----SortExec: TopK(fetch=1), expr=[c13@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec query ? SELECT ARRAY_AGG(c13) as array_agg1 FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1) ---- -[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm] +NULL statement ok set datafusion.optimizer.repartition_windows = true; @@ -2170,11 +1848,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- --16110 61035129 -3917 -108973366 --16974 623103518 --1114 -1927628110 -15673 -1899175111 # test_window_agg_partition_by_set # These tests check whether BoundedWindowAggExec and WindowAggExec treat PARTITION BY expressions as a set. @@ -2212,7 +1885,7 @@ physical_plan 06)----------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING: Field { "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND 5 FOLLOWING], mode=[Sorted] 07)------------WindowAggExec: wdw=[sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "sum(aggregate_test_100.c9) PARTITION BY [aggregate_test_100.c1, aggregate_test_100.c2] ORDER BY [aggregate_test_100.c9 ASC NULLS LAST, aggregate_test_100.c8 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(NULL)), is_causal: false }] 08)--------------SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST, c9@3 ASC NULLS LAST, c8@2 ASC NULLS LAST], preserve_partitioning=[false] -09)----------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c8, c9], file_type=csv, has_header=true +09)----------------EmptyExec @@ -2226,11 +1899,6 @@ SELECT c9, ORDER BY c9 LIMIT 5 ---- -28774375 9144476174 9144476174 12665844451 12665844451 -63044568 5125627947 5125627947 5125627947 5125627947 -141047417 3650978969 3650978969 3650978969 3650978969 -141680161 8526017165 8526017165 11924524414 11924524414 -145294611 6802765992 6802765992 6802765992 6802765992 # test_window_agg_child_equivalence @@ -2269,7 +1937,7 @@ physical_plan 08)--------------WindowAggExec: wdw=[sum(t1.c9) PARTITION BY [t1.c1, t1.c2] ORDER BY [t1.c9 ASC NULLS LAST, t1.c8 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "sum(t1.c9) PARTITION BY [t1.c1, t1.c2] ORDER BY [t1.c9 ASC NULLS LAST, t1.c8 ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND UNBOUNDED FOLLOWING", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(NULL)), is_causal: false }] 09)----------------SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST, c9@3 ASC NULLS LAST, c8@2 ASC NULLS LAST], preserve_partitioning=[false] 10)------------------ProjectionExec: expr=[c1@0 as c1, c2@1 as c2, c8@2 as c8, c9@3 as c9, c1@0 as c1_alias] -11)--------------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c8, c9], file_type=csv, has_header=true +11)--------------------EmptyExec query IIIII SELECT c9, @@ -2282,11 +1950,6 @@ SELECT c9, ORDER BY c9) t1 LIMIT 5 ---- -774637006 12189635055 12189635055 12189635055 12189635055 -1454057357 12189635055 12189635055 12189635055 12189635055 -2669374863 11414998049 11414998049 11414998049 11414998049 -3276123488 9960940692 9960940692 9960940692 9960940692 -4015442341 7291565829 7291565829 7291565829 7291565829 # test_window_agg_with_bounded_group @@ -2311,18 +1974,13 @@ physical_plan 05)--------ProjectionExec: expr=[c1@0 as c1, c9@2 as c9, c12@3 as c12, sum(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING@4 as sum(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING] 06)----------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING: Field { "sum(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c1 ASC NULLS LAST, aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING": nullable Float64 }, frame: GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING], mode=[Sorted] 07)------------SortExec: expr=[c1@0 ASC NULLS LAST, c2@1 ASC NULLS LAST], preserve_partitioning=[false] -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c2, c9, c12], file_type=csv, has_header=true +08)--------------EmptyExec query RR SELECT SUM(c12) OVER(ORDER BY c1, c2 GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as sum1, SUM(c12) OVER(ORDER BY c1 GROUPS BETWEEN 5 PRECEDING AND 3 PRECEDING) as sum2 FROM aggregate_test_100 ORDER BY c9 LIMIT 5 ---- -4.561269874379 18.036183428008 -6.808931568966 10.238448667883 -2.994840293343 NULL -9.674390599321 NULL -7.728066219895 NULL # test_c9_rn_ordering_alias # These tests check whether DataFusion is aware of the ordering generated by the ROW_NUMBER() window function. @@ -2345,7 +2003,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec query II SELECT c9, rn1 FROM (SELECT c9, @@ -2355,11 +2013,6 @@ SELECT c9, rn1 FROM (SELECT c9, ORDER BY rn1 LIMIT 5 ---- -28774375 1 -63044568 2 -141047417 3 -141680161 4 -145294611 5 # test_c9_rn_ordering_alias_opposite_direction # These tests check whether DataFusion is aware of the ordering generated by the ROW_NUMBER() window function. @@ -2382,7 +2035,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec query II SELECT c9, rn1 FROM (SELECT c9, @@ -2392,11 +2045,6 @@ SELECT c9, rn1 FROM (SELECT c9, ORDER BY rn1 LIMIT 5 ---- -4268716378 1 -4229654142 2 -4216440507 3 -4144173353 4 -4076864659 5 # test_c9_rn_ordering_alias_opposite_direction2 # These tests check whether DataFusion is aware of the ordering generated by the ROW_NUMBER() window function. @@ -2419,7 +2067,7 @@ physical_plan 02)--ProjectionExec: expr=[c9@0 as c9, row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@1 as rn1] 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec query II SELECT c9, rn1 FROM (SELECT c9, @@ -2429,11 +2077,6 @@ SELECT c9, rn1 FROM (SELECT c9, ORDER BY rn1 DESC LIMIT 5 ---- -28774375 100 -63044568 99 -141047417 98 -141680161 97 -145294611 96 # test_c9_rn_ordering_alias_opposite_direction3 # These test check for whether datafusion is aware of the ordering of the column generated by ROW_NUMBER() window function. @@ -2459,7 +2102,7 @@ physical_plan 02)--ProjectionExec: expr=[c9@0 as c9, row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@1 as rn1] 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec query II SELECT c9, rn1 FROM (SELECT c9, @@ -2469,11 +2112,6 @@ SELECT c9, rn1 FROM (SELECT c9, ORDER BY rn1 ASC, c9 DESC LIMIT 5 ---- -4268716378 1 -4229654142 2 -4216440507 3 -4144173353 4 -4076864659 5 # invalid window frame. null as preceding @@ -2534,7 +2172,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec # This test shows that ordering equivalence can keep track of complex expressions (not just Column expressions) # during ordering satisfy analysis. In the final plan we should only see single SortExec. @@ -2556,7 +2194,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 + aggregate_test_100.c5 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 + aggregate_test_100.c5 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[CAST(c9@1 AS Decimal128(20, 0)) + CAST(c5@0 AS Decimal128(20, 0)) DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c5, c9], file_type=csv, has_header=true +05)--------EmptyExec # Ordering equivalence should be preserved during cast expression query TT @@ -2577,7 +2215,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec # The following query has type error. We should test the error could be detected # from either the logical plan (when `skip_failed_rules` is set to `false`) or @@ -3245,7 +2883,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c9 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: expr=[c9@0 DESC], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +05)--------EmptyExec # Query below should work when its input is unbounded # because ordering of ROW_NUMBER, RANK result is added to the ordering equivalence @@ -3400,11 +3038,6 @@ SELECT ORDER BY C3, max2 LIMIT 5 ---- --117 0.850672105305 0.850672105305 --117 0.970671228336 0.970671228336 --111 0.152498292972 0.152498292972 --107 0.369363046006 0.369363046006 --106 0.56535284223 0.56535284223 query TT EXPLAIN SELECT @@ -3433,7 +3066,7 @@ physical_plan 05)--------ProjectionExec: expr=[c3@0 as c3, c12@2 as c12, min(aggregate_test_100.c12) PARTITION BY [aggregate_test_100.c11] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@3 as min(aggregate_test_100.c12) PARTITION BY [aggregate_test_100.c11] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING] 06)----------WindowAggExec: wdw=[min(aggregate_test_100.c12) PARTITION BY [aggregate_test_100.c11] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "min(aggregate_test_100.c12) PARTITION BY [aggregate_test_100.c11] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: Float64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] 07)------------SortExec: expr=[c11@1 ASC NULLS LAST], preserve_partitioning=[false] -08)--------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c3, c11, c12], file_type=csv, has_header=true +08)--------------EmptyExec # window1 spec is used multiple times under different aggregations. # The query should still work. @@ -3447,11 +3080,6 @@ SELECT ORDER BY C3, min1 LIMIT 5 ---- --117 0.850672105305 0.014793053078 --117 0.970671228336 0.014793053078 --111 0.152498292972 0.014793053078 --107 0.369363046006 0.014793053078 --106 0.56535284223 0.014793053078 query TT EXPLAIN SELECT @@ -3474,7 +3102,7 @@ physical_plan 03)----ProjectionExec: expr=[max(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@2 as min1, min(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as max1, c3@0 as c3] 04)------BoundedWindowAggExec: wdw=[max(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "max(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Float64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, min(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "min(aggregate_test_100.c12) ORDER BY [aggregate_test_100.c12 ASC NULLS LAST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Float64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 05)--------SortExec: expr=[c12@1 ASC NULLS LAST], preserve_partitioning=[false] -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c3, c12], file_type=csv, has_header=true +06)----------EmptyExec # window2 spec is not defined statement error DataFusion error: Error during planning: The window window2 is not defined! @@ -3992,11 +3620,6 @@ FROM (SELECT c1, c2, ROW_NUMBER() OVER() as rn GROUP BY rn ORDER BY rn; ---- -c 2 1 -d 5 2 -b 1 3 -a 1 4 -b 5 5 # when partition by expression is constant row number result will be unique. query TII @@ -4007,11 +3630,6 @@ FROM (SELECT c1, c2, ROW_NUMBER() OVER(PARTITION BY 3) as rn GROUP BY rn ORDER BY rn; ---- -c 2 1 -d 5 2 -b 1 3 -a 1 4 -b 5 5 # Schema error: No field named aggregate_test_100.c1. Valid fields are rn. statement error @@ -4176,7 +3794,7 @@ physical_plan 04)------ProjectionExec: expr=[c3@0 as c3, c4@1 as c4, c9@2 as c9, sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW@3 as sum1] 05)--------BoundedWindowAggExec: wdw=[sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(aggregate_test_100.c9) ORDER BY [aggregate_test_100.c3 + aggregate_test_100.c4 DESC NULLS FIRST] RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 06)----------SortExec: expr=[c3@0 + c4@1 DESC], preserve_partitioning=[false] -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c3, c4, c9], file_type=csv, has_header=true +07)------------EmptyExec query III SELECT c3, @@ -4189,11 +3807,6 @@ SELECT c3, ) limit 5 ---- --86 222089770060 2861911482 -13 219227858578 5075947208 -125 217013822852 8701233618 -123 213388536442 11293564174 -97 210796205886 14767488750 statement ok create table a (a bigint) AS VALUES (1); @@ -5586,12 +5199,10 @@ logical_plan 03)----WindowAggr: windowExpr=[[sum(CAST(aggregate_test_100_ordered.c9 AS UInt64)) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]] 04)------TableScan: aggregate_test_100_ordered projection=[c1, c9] physical_plan -01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST, sum_c9@1 ASC NULLS LAST] -02)--ProjectionExec: expr=[c1@0 as c1, sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@2 as sum_c9] -03)----WindowAggExec: wdw=[sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] -04)------CoalesceBatchesExec: target_batch_size=1 -05)--------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c9], output_ordering=[c1@0 ASC NULLS LAST], file_type=csv, has_header=true +01)ProjectionExec: expr=[c1@0 as c1, sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@2 as sum_c9] +02)--WindowAggExec: wdw=[sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "sum(aggregate_test_100_ordered.c9) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] +03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec query TT EXPLAIN SELECT SUM(c9) OVER() as sum_c9 FROM aggregate_test_100_ordered ORDER BY sum_c9; @@ -5604,7 +5215,7 @@ logical_plan physical_plan 01)ProjectionExec: expr=[sum(aggregate_test_100_ordered.c9) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as sum_c9] 02)--WindowAggExec: wdw=[sum(aggregate_test_100_ordered.c9) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "sum(aggregate_test_100_ordered.c9) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: UInt64, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c9], file_type=csv, has_header=true +03)----EmptyExec query TT @@ -5616,12 +5227,10 @@ logical_plan 03)----WindowAggr: windowExpr=[[min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING]] 04)------TableScan: aggregate_test_100_ordered projection=[c1, c5] physical_plan -01)SortPreservingMergeExec: [c1@0 ASC NULLS LAST, min_c5@1 DESC NULLS LAST] -02)--ProjectionExec: expr=[c1@0 as c1, min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@2 as min_c5] -03)----WindowAggExec: wdw=[min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: Int32, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] -04)------CoalesceBatchesExec: target_batch_size=1 -05)--------RepartitionExec: partitioning=Hash([c1@0], 2), input_partitions=1 -06)----------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c1, c5], output_ordering=[c1@0 ASC NULLS LAST], file_type=csv, has_header=true +01)ProjectionExec: expr=[c1@0 as c1, min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@2 as min_c5] +02)--WindowAggExec: wdw=[min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "min(aggregate_test_100_ordered.c5) PARTITION BY [aggregate_test_100_ordered.c1] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: Int32, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] +03)----SortExec: expr=[c1@0 ASC NULLS LAST], preserve_partitioning=[false] +04)------EmptyExec query TT EXPLAIN SELECT MAX(c5) OVER() as max_c5 FROM aggregate_test_100_ordered ORDER BY max_c5; @@ -5634,7 +5243,7 @@ logical_plan physical_plan 01)ProjectionExec: expr=[max(aggregate_test_100_ordered.c5) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING@1 as max_c5] 02)--WindowAggExec: wdw=[max(aggregate_test_100_ordered.c5) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING: Ok(Field { name: "max(aggregate_test_100_ordered.c5) ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING", data_type: Int32, nullable: true }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: Following(UInt64(NULL)), is_causal: false }] -03)----DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100.csv]]}, projection=[c5], file_type=csv, has_header=true +03)----EmptyExec query II rowsort SELECT @@ -5669,11 +5278,6 @@ FROM aggregate_test_100_utf8view ORDER BY c9 LIMIT 5 ---- -2100 100 -510 79 -1440 21 -1830 61 -2010 21 #fn test_window_rank @@ -5690,11 +5294,6 @@ SELECT ORDER BY c9 LIMIT 5 ---- -28774375 80 80 5 5 0.79797979798 0.79797979798 -63044568 62 62 4 4 0.616161616162 0.616161616162 -141047417 1 1 1 1 0 0 -141680161 41 41 3 3 0.40404040404 0.40404040404 -145294611 1 1 1 1 0 0 # CTAS with NTILE function diff --git a/datafusion/sqllogictest/test_files/window_limits.slt b/datafusion/sqllogictest/test_files/window_limits.slt index 8729e5ed412e..4091ee09c388 100644 --- a/datafusion/sqllogictest/test_files/window_limits.slt +++ b/datafusion/sqllogictest/test_files/window_limits.slt @@ -45,9 +45,6 @@ set datafusion.optimizer.enable_window_limits = false; query I SELECT LEAD(empno) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -299 -363 -417 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -55,9 +52,6 @@ set datafusion.optimizer.enable_window_limits = true; query I SELECT LEAD(empno) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -299 -363 -417 query TT EXPLAIN @@ -73,7 +67,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=3 03)----BoundedWindowAggExec: wdw=[lead(employees.empno) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.empno) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Int32 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=4), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # lead defaults can lookahead by any amount and should grow limit statement ok @@ -82,9 +76,6 @@ set datafusion.optimizer.enable_window_limits = false; query I SELECT LEAD(empno, 2) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -363 -417 -794 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -92,9 +83,6 @@ set datafusion.optimizer.enable_window_limits = true; query I SELECT LEAD(empno, 2) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -363 -417 -794 query TT EXPLAIN @@ -110,7 +98,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=3 03)----BoundedWindowAggExec: wdw=[lead(employees.empno,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.empno,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Int32 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=5), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # Should use the max of leads statement ok @@ -126,11 +114,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 28774375 557517119 4015442341 -299 1865307672 4061635107 3542840110 -363 557517119 4015442341 1088543984 -417 4061635107 3542840110 1362369177 -794 4015442341 1088543984 145294611 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -145,11 +128,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 28774375 557517119 4015442341 -299 1865307672 4061635107 3542840110 -363 557517119 4015442341 1088543984 -417 4061635107 3542840110 1362369177 -794 4015442341 1088543984 145294611 query TT EXPLAIN @@ -172,7 +150,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[lead(employees.salary,Int64(1)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.salary,Int64(1)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, lead(employees.salary,Int64(3)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.salary,Int64(3)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, lead(employees.salary,Int64(5)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.salary,Int64(5)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=10), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno, salary], file_type=csv, has_header=true +05)--------EmptyExec # 2 < 3... nth_value should not grow the limit statement ok @@ -181,9 +159,6 @@ set datafusion.optimizer.enable_window_limits = false; query I SELECT NTH_VALUE(empno, 2) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -NULL -299 -299 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -191,9 +166,6 @@ set datafusion.optimizer.enable_window_limits = true; query I SELECT NTH_VALUE(empno, 2) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -NULL -299 -299 query TT EXPLAIN @@ -209,7 +181,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=3 03)----BoundedWindowAggExec: wdw=[nth_value(employees.empno,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "nth_value(employees.empno,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Int32 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=3), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # 5 > 3... nth_value still won't grow the limit - it's causal statement ok @@ -218,9 +190,6 @@ set datafusion.optimizer.enable_window_limits = false; query I SELECT NTH_VALUE(empno, 5) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -NULL -NULL -NULL statement ok set datafusion.optimizer.enable_window_limits = true; @@ -228,9 +197,6 @@ set datafusion.optimizer.enable_window_limits = true; query I SELECT NTH_VALUE(empno, 5) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM employees LIMIT 3 ---- -NULL -NULL -NULL query TT EXPLAIN @@ -246,7 +212,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=3 03)----BoundedWindowAggExec: wdw=[nth_value(employees.empno,Int64(5)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "nth_value(employees.empno,Int64(5)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Int32 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=3), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # aggregate functions shouldn't affect the window statement ok @@ -263,11 +229,6 @@ SELECT FROM employees LIMIT 5; ---- -a 102 3276123488 3276123488 3276123488 3276123488 -e 299 3304897863 1652448931.5 28774375 3276123488 -a 363 5170205535 1723401845 28774375 3276123488 -e 417 5727722654 1431930663.5 28774375 3276123488 -d 794 9789357761 1957871552.2 28774375 4061635107 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -283,11 +244,6 @@ SELECT FROM employees LIMIT 5; ---- -a 102 3276123488 3276123488 3276123488 3276123488 -e 299 3304897863 1652448931.5 28774375 3276123488 -a 363 5170205535 1723401845 28774375 3276123488 -e 417 5727722654 1431930663.5 28774375 3276123488 -d 794 9789357761 1957871552.2 28774375 4061635107 query TT EXPLAIN @@ -311,7 +267,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[sum(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "sum(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, avg(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "avg(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable Float64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, min(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "min(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, max(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "max(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=5), expr=[empno@1 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[depname, empno, salary], file_type=csv, has_header=true +05)--------EmptyExec # ranking functions that don't affect the limit statement ok @@ -327,11 +283,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 1 1 1 -299 2 2 2 -363 3 3 3 -417 4 4 4 -794 5 5 5 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -346,11 +297,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 1 1 1 -299 2 2 2 -363 3 3 3 -417 4 4 4 -794 5 5 5 query TT EXPLAIN @@ -373,7 +319,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[row_number() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "row_number() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, dense_rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "dense_rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=5), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # Unoptimizable global ranking functions statement ok @@ -389,11 +335,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 0 0.01 1 -299 0.010101010101 0.02 1 -363 0.020202020202 0.03 1 -417 0.030303030303 0.04 1 -794 0.040404040404 0.05 1 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -408,11 +349,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 0 0.01 1 -299 0.010101010101 0.02 1 -363 0.020202020202 0.03 1 -417 0.030303030303 0.04 1 -794 0.040404040404 0.05 1 query TT EXPLAIN @@ -435,7 +371,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----WindowAggExec: wdw=[percent_rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "percent_rank() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: Float64 }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: CurrentRow, is_causal: true }, cume_dist() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "cume_dist() ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: Float64 }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: CurrentRow, is_causal: true }, ntile(Int64(4)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Ok(Field { name: "ntile(Int64(4)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW", data_type: UInt64 }), frame: WindowFrame { units: Rows, start_bound: Preceding(UInt64(NULL)), end_bound: CurrentRow, is_causal: true }] 04)------SortExec: expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno], file_type=csv, has_header=true +05)--------EmptyExec # Analytical functions that don't lookahead statement ok @@ -452,11 +388,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 3276123488 NULL 3276123488 NULL -299 3276123488 3276123488 28774375 NULL -363 3276123488 28774375 1865307672 1865307672 -417 3276123488 1865307672 557517119 1865307672 -794 3276123488 557517119 4061635107 1865307672 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -472,11 +403,6 @@ FROM employees ORDER BY empno LIMIT 5; ---- -102 3276123488 NULL 3276123488 NULL -299 3276123488 3276123488 28774375 NULL -363 3276123488 28774375 1865307672 1865307672 -417 3276123488 1865307672 557517119 1865307672 -794 3276123488 557517119 4061635107 1865307672 query TT EXPLAIN @@ -500,7 +426,7 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[first_value(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "first_value(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, lag(employees.salary,Int64(1)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lag(employees.salary,Int64(1)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, last_value(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "last_value(employees.salary) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, nth_value(employees.salary,Int64(3)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "nth_value(employees.salary,Int64(3)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=5), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno, salary], file_type=csv, has_header=true +05)--------EmptyExec # should handle partition by unoptimized statement ok @@ -516,11 +442,6 @@ FROM employees ORDER BY depname LIMIT 5 ---- -a 102 3276123488 3276123488 -a 363 1865307672 5141431160 -a 829 4015442341 5880750013 -a 2555 145294611 4160736952 -a 2809 754775609 900070220 query TT EXPLAIN @@ -539,13 +460,11 @@ logical_plan 03)----WindowAggr: windowExpr=[[sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW]] 04)------TableScan: employees projection=[depname, empno, salary] physical_plan -01)SortPreservingMergeExec: [depname@0 ASC NULLS LAST], fetch=5 -02)--ProjectionExec: expr=[depname@0 as depname, empno@1 as empno, salary@2 as salary, sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW@3 as running_sum] +01)ProjectionExec: expr=[depname@0 as depname, empno@1 as empno, salary@2 as salary, sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW@3 as running_sum] +02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW: Field { "sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND CURRENT ROW], mode=[Sorted] -04)------SortExec: expr=[depname@0 ASC NULLS LAST, empno@1 ASC NULLS LAST], preserve_partitioning=[true] -05)--------CoalesceBatchesExec: target_batch_size=8192 -06)----------RepartitionExec: partitioning=Hash([depname@0], 4), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[depname, empno, salary], file_type=csv, has_header=true +04)------SortExec: expr=[depname@0 ASC NULLS LAST, empno@1 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec # should handle partition by optimized statement ok @@ -561,11 +480,6 @@ FROM employees ORDER BY depname LIMIT 5 ---- -a 102 3276123488 3276123488 -a 363 1865307672 5141431160 -a 829 4015442341 5880750013 -a 2555 145294611 4160736952 -a 2809 754775609 900070220 query TT EXPLAIN @@ -584,13 +498,11 @@ logical_plan 03)----WindowAggr: windowExpr=[[sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW]] 04)------TableScan: employees projection=[depname, empno, salary] physical_plan -01)SortPreservingMergeExec: [depname@0 ASC NULLS LAST], fetch=5 -02)--ProjectionExec: expr=[depname@0 as depname, empno@1 as empno, salary@2 as salary, sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW@3 as running_sum] +01)ProjectionExec: expr=[depname@0 as depname, empno@1 as empno, salary@2 as salary, sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW@3 as running_sum] +02)--GlobalLimitExec: skip=0, fetch=5 03)----BoundedWindowAggExec: wdw=[sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW: Field { "sum(employees.salary) PARTITION BY [employees.depname] ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN 1 PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN 1 PRECEDING AND CURRENT ROW], mode=[Sorted] -04)------SortExec: TopK(fetch=5), expr=[depname@0 ASC NULLS LAST, empno@1 ASC NULLS LAST], preserve_partitioning=[true] -05)--------CoalesceBatchesExec: target_batch_size=8192 -06)----------RepartitionExec: partitioning=Hash([depname@0], 4), input_partitions=1 -07)------------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[depname, empno, salary], file_type=csv, has_header=true +04)------SortExec: TopK(fetch=5), expr=[depname@0 ASC NULLS LAST, empno@1 ASC NULLS LAST], preserve_partitioning=[false] +05)--------EmptyExec # unbounded following statement ok @@ -601,11 +513,6 @@ SELECT LEAD(salary) OVER (ORDER BY empno ROWS BETWEEN CURRENT ROW AND UNBOUNDED FROM employees LIMIT 5; ---- -28774375 -1865307672 -557517119 -4061635107 -4015442341 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -615,11 +522,6 @@ SELECT LEAD(salary) OVER (ORDER BY empno ROWS BETWEEN CURRENT ROW AND UNBOUNDED FROM employees LIMIT 5; ---- -28774375 -1865307672 -557517119 -4061635107 -4015442341 # RANGE statement ok @@ -630,11 +532,6 @@ SELECT LEAD(salary) OVER (ORDER BY empno RANGE BETWEEN UNBOUNDED PRECEDING AND C FROM employees LIMIT 5; ---- -28774375 -1865307672 -557517119 -4061635107 -4015442341 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -644,11 +541,6 @@ SELECT LEAD(salary) OVER (ORDER BY empno RANGE BETWEEN UNBOUNDED PRECEDING AND C FROM employees LIMIT 5; ---- -28774375 -1865307672 -557517119 -4061635107 -4015442341 # multiple windows statement ok @@ -661,11 +553,6 @@ SELECT FROM employees LIMIT 5; ---- -28774375 4015442341 -1865307672 3542840110 -557517119 1088543984 -4061635107 1362369177 -4015442341 145294611 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -677,11 +564,6 @@ SELECT FROM employees LIMIT 5; ---- -28774375 4015442341 -1865307672 3542840110 -557517119 1088543984 -4061635107 1362369177 -4015442341 145294611 # sliding statement ok @@ -695,9 +577,6 @@ SELECT FROM employees LIMIT 3; ---- -102 3276123488 3276123488 -299 28774375 3304897863 -363 1865307672 5170205535 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -710,9 +589,6 @@ SELECT FROM employees LIMIT 3; ---- -102 3276123488 3276123488 -299 28774375 3304897863 -363 1865307672 5170205535 # sliding lead statement ok @@ -726,9 +602,6 @@ SELECT FROM employees LIMIT 3; ---- -102 3276123488 1865307672 -299 28774375 557517119 -363 1865307672 4061635107 statement ok set datafusion.optimizer.enable_window_limits = true; @@ -741,9 +614,6 @@ SELECT FROM employees LIMIT 3; ---- -102 3276123488 1865307672 -299 28774375 557517119 -363 1865307672 4061635107 query TT EXPLAIN @@ -764,4 +634,4 @@ physical_plan 02)--GlobalLimitExec: skip=0, fetch=3 03)----BoundedWindowAggExec: wdw=[lead(employees.salary,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW: Field { "lead(employees.salary,Int64(2)) ORDER BY [employees.empno ASC NULLS LAST] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW": nullable UInt64 }, frame: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], mode=[Sorted] 04)------SortExec: TopK(fetch=5), expr=[empno@0 ASC NULLS LAST], preserve_partitioning=[false] -05)--------DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/csv/aggregate_test_100_with_dates.csv]]}, projection=[empno, salary], file_type=csv, has_header=true +05)--------EmptyExec