From 313e4e3838e5759ab331e695851bcfb7317a6e4d Mon Sep 17 00:00:00 2001
From: Piotr Findeisen <piotr.findeisen@gmail.com>
Date: Thu, 12 Dec 2024 15:24:30 +0100
Subject: [PATCH 1/5] Add big decimal formatting test cases with potential
 trailing zeros

---
 datafusion/sqllogictest/src/engines/conversion.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index 8d2fd1e6d0f2..3bfe35223593 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -149,6 +149,7 @@ mod tests {
 
     #[test]
     fn test_big_decimal_to_str() {
+        assert_decimal_str_eq!(110, 3, "0.11");
         assert_decimal_str_eq!(11, 3, "0.011");
         assert_decimal_str_eq!(11, 2, "0.11");
         assert_decimal_str_eq!(11, 1, "1.1");
@@ -157,6 +158,7 @@ mod tests {
         assert_decimal_str_eq!(0, 0, "0");
 
         // Negative cases
+        assert_decimal_str_eq!(-110, 3, "-0.11");
         assert_decimal_str_eq!(-11, 3, "-0.011");
         assert_decimal_str_eq!(-11, 2, "-0.11");
         assert_decimal_str_eq!(-11, 1, "-1.1");

From 7624c5481ef319dfeef72151062daf1a62d7c335 Mon Sep 17 00:00:00 2001
From: Piotr Findeisen <piotr.findeisen@gmail.com>
Date: Thu, 12 Dec 2024 15:18:13 +0100
Subject: [PATCH 2/5] Rename and simplify decimal rendering functions

- add `decimal` to function name
- drop `precision` parameter as it is not supposed to affect the result
---
 datafusion/sqllogictest/src/engines/conversion.rs      | 10 ++++++----
 .../src/engines/datafusion_engine/normalize.rs         |  8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index 3bfe35223593..e4e9c5d284c5 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -81,16 +81,18 @@ pub(crate) fn f64_to_str(value: f64) -> String {
     }
 }
 
-pub(crate) fn i128_to_str(value: i128, precision: &u8, scale: &i8) -> String {
+pub(crate) fn decimal_128_to_str(value: i128, scale: i8) -> String {
+    let precision = u8::MAX; // does not matter
     big_decimal_to_str(
-        BigDecimal::from_str(&Decimal128Type::format_decimal(value, *precision, *scale))
+        BigDecimal::from_str(&Decimal128Type::format_decimal(value, precision, scale))
             .unwrap(),
     )
 }
 
-pub(crate) fn i256_to_str(value: i256, precision: &u8, scale: &i8) -> String {
+pub(crate) fn decimal_256_to_str(value: i256, scale: i8) -> String {
+    let precision = u8::MAX; // does not matter
     big_decimal_to_str(
-        BigDecimal::from_str(&Decimal256Type::format_decimal(value, *precision, *scale))
+        BigDecimal::from_str(&Decimal256Type::format_decimal(value, precision, scale))
             .unwrap(),
     )
 }
diff --git a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
index 4146c7cf8010..b80f0ef075ff 100644
--- a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
+++ b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
@@ -213,13 +213,13 @@ pub fn cell_to_string(col: &ArrayRef, row: usize) -> Result<String> {
             DataType::Float64 => {
                 Ok(f64_to_str(get_row_value!(array::Float64Array, col, row)))
             }
-            DataType::Decimal128(precision, scale) => {
+            DataType::Decimal128(_, scale) => {
                 let value = get_row_value!(array::Decimal128Array, col, row);
-                Ok(i128_to_str(value, precision, scale))
+                Ok(decimal_128_to_str(value, *scale))
             }
-            DataType::Decimal256(precision, scale) => {
+            DataType::Decimal256(_, scale) => {
                 let value = get_row_value!(array::Decimal256Array, col, row);
-                Ok(i256_to_str(value, precision, scale))
+                Ok(decimal_256_to_str(value, *scale))
             }
             DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(
                 array::LargeStringArray,

From af5b84bff98322de599d2f24d67cfa7b8850047a Mon Sep 17 00:00:00 2001
From: Piotr Findeisen <piotr.findeisen@gmail.com>
Date: Thu, 12 Dec 2024 15:12:25 +0100
Subject: [PATCH 3/5] Update to bigdecimal 0.4.7

Utilize new `to_plain_string` function
---
 Cargo.toml                                    |  2 +-
 .../sqllogictest/src/engines/conversion.rs    | 29 ++++---------------
 2 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 0c76ff196a10..cc94b4292a50 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -93,7 +93,7 @@ arrow-ipc = { version = "53.3.0", default-features = false, features = [
 arrow-ord = { version = "53.3.0", default-features = false }
 arrow-schema = { version = "53.3.0", default-features = false }
 async-trait = "0.1.73"
-bigdecimal = "0.4.6"
+bigdecimal = "0.4.7"
 bytes = "1.4"
 chrono = { version = "0.4.38", default-features = false }
 ctor = "0.2.0"
diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index e4e9c5d284c5..58b34d248324 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -106,30 +106,7 @@ pub(crate) fn big_decimal_to_str(value: BigDecimal) -> String {
     // Round the value to limit the number of decimal places
     let value = value.round(12).normalized();
     // Format the value to a string
-    format_big_decimal(value)
-}
-
-fn format_big_decimal(value: BigDecimal) -> String {
-    let (integer, scale) = value.into_bigint_and_exponent();
-    let mut str = integer.to_str_radix(10);
-    if scale <= 0 {
-        // Append zeros to the right of the integer part
-        str.extend(std::iter::repeat('0').take(scale.unsigned_abs() as usize));
-        str
-    } else {
-        let (sign, unsigned_len, unsigned_str) = if integer.is_negative() {
-            ("-", str.len() - 1, &str[1..])
-        } else {
-            ("", str.len(), &str[..])
-        };
-        let scale = scale as usize;
-        if unsigned_len <= scale {
-            format!("{}0.{:0>scale$}", sign, unsigned_str)
-        } else {
-            str.insert(str.len() - scale, '.');
-            str
-        }
-    }
+    value.to_plain_string()
 }
 
 #[cfg(test)]
@@ -158,6 +135,8 @@ mod tests {
         assert_decimal_str_eq!(11, 0, "11");
         assert_decimal_str_eq!(11, -1, "110");
         assert_decimal_str_eq!(0, 0, "0");
+        assert_decimal_str_eq!(12345678901234567890123456789012345678_i128, 0, "12345678901234567890123456789012345678");
+        assert_decimal_str_eq!(12345678901234567890123456789012345678_i128, 38, "0.123456789012");
 
         // Negative cases
         assert_decimal_str_eq!(-110, 3, "-0.11");
@@ -166,6 +145,8 @@ mod tests {
         assert_decimal_str_eq!(-11, 1, "-1.1");
         assert_decimal_str_eq!(-11, 0, "-11");
         assert_decimal_str_eq!(-11, -1, "-110");
+        assert_decimal_str_eq!(-12345678901234567890123456789012345678_i128, 0, "-12345678901234567890123456789012345678");
+        assert_decimal_str_eq!(-12345678901234567890123456789012345678_i128, 38, "-0.123456789012");
 
         // Round to 12 decimal places
         // 1.0000000000011 -> 1.000000000001

From 5124c27196467c0abdfb981474be06acd1c630d7 Mon Sep 17 00:00:00 2001
From: Piotr Findeisen <piotr.findeisen@gmail.com>
Date: Thu, 12 Dec 2024 17:33:24 +0100
Subject: [PATCH 4/5] Support sqllogictest --complete with postgres

Before the change, the request to use PostgreSQL was simply ignored when
`--complete` flag was present.
---
 datafusion/sqllogictest/bin/sqllogictests.rs | 46 +++++++++++++++++---
 1 file changed, 40 insertions(+), 6 deletions(-)

diff --git a/datafusion/sqllogictest/bin/sqllogictests.rs b/datafusion/sqllogictest/bin/sqllogictests.rs
index 176bd3229125..be3f1cb251b6 100644
--- a/datafusion/sqllogictest/bin/sqllogictests.rs
+++ b/datafusion/sqllogictest/bin/sqllogictests.rs
@@ -101,12 +101,11 @@ async fn run_tests() -> Result<()> {
             SpawnedTask::spawn(async move {
                 let file_path = test_file.relative_path.clone();
                 let start = datafusion::common::instant::Instant::now();
-                if options.complete {
-                    run_complete_file(test_file).await?;
-                } else if options.postgres_runner {
-                    run_test_file_with_postgres(test_file).await?;
-                } else {
-                    run_test_file(test_file).await?;
+                match (options.postgres_runner, options.complete) {
+                    (false, false) => run_test_file(test_file).await?,
+                    (false, true) => run_complete_file(test_file).await?,
+                    (true, false) => run_test_file_with_postgres(test_file).await?,
+                    (true, true) => run_complete_file_with_postgres(test_file).await?,
                 }
                 println!("Executed {:?}. Took {:?}", file_path, start.elapsed());
                 Ok(()) as Result<()>
@@ -227,6 +226,41 @@ async fn run_complete_file(test_file: TestFile) -> Result<()> {
         })
 }
 
+#[cfg(feature = "postgres")]
+async fn run_complete_file_with_postgres(test_file: TestFile) -> Result<()> {
+    use datafusion_sqllogictest::Postgres;
+    let TestFile {
+        path,
+        relative_path,
+    } = test_file;
+    info!(
+        "Using complete mode to complete with Postgres runner: {}",
+        path.display()
+    );
+    setup_scratch_dir(&relative_path)?;
+    let mut runner =
+        sqllogictest::Runner::new(|| Postgres::connect(relative_path.clone()));
+    let col_separator = " ";
+    runner
+        .update_test_file(
+            path,
+            col_separator,
+            value_validator,
+            strict_column_validator,
+        )
+        .await
+        // Can't use e directly because it isn't marked Send, so turn it into a string.
+        .map_err(|e| {
+            DataFusionError::Execution(format!("Error completing {relative_path:?}: {e}"))
+        })
+}
+
+#[cfg(not(feature = "postgres"))]
+async fn run_complete_file_with_postgres(_test_file: TestFile) -> Result<()> {
+    use datafusion_common::plan_err;
+    plan_err!("Can not run with postgres as postgres feature is not enabled")
+}
+
 /// Represents a parsed test file
 #[derive(Debug)]
 struct TestFile {

From b2c20bfc492eea9ee13fb09e72a08ebd8501dc6a Mon Sep 17 00:00:00 2001
From: Piotr Findeisen <piotr.findeisen@gmail.com>
Date: Thu, 12 Dec 2024 15:23:25 +0100
Subject: [PATCH 5/5] Round floats but not decimals in SqlLogicTests

- stop rounding decimal values in SLT. It's the very nature of decimal
  arithmetics that it should in general be exact.
- round float values taking into account the bit width of the float. The
  Float64 carries more information than Float32 or Float16.
---
 .../sqllogictest/src/engines/conversion.rs    | 220 ++++--
 .../sqllogictest/test_files/aggregate.slt     | 272 +++----
 .../test_files/aggregate_skip_partial.slt     | 140 ++--
 datafusion/sqllogictest/test_files/array.slt  |  24 +-
 .../sqllogictest/test_files/clickbench.slt    |   2 +-
 datafusion/sqllogictest/test_files/ddl.slt    |   2 +-
 .../sqllogictest/test_files/decimal.slt       |   2 +-
 .../sqllogictest/test_files/distinct_on.slt   |   6 +-
 datafusion/sqllogictest/test_files/expr.slt   |   8 +-
 .../test_files/expr/date_part.slt             |  10 +-
 .../sqllogictest/test_files/functions.slt     |  16 +-
 datafusion/sqllogictest/test_files/group.slt  |  70 +-
 datafusion/sqllogictest/test_files/join.slt   |   4 +-
 datafusion/sqllogictest/test_files/joins.slt  |   2 +-
 datafusion/sqllogictest/test_files/math.slt   |   2 +-
 .../sqllogictest/test_files/options.slt       |   2 +-
 datafusion/sqllogictest/test_files/order.slt  |   2 +-
 .../test_files/pg_compat/pg_compat_simple.slt | 212 +++---
 .../test_files/pg_compat/pg_compat_window.slt | 666 +++++++++---------
 .../sqllogictest/test_files/predicates.slt    |   4 +-
 .../sqllogictest/test_files/projection.slt    |  10 +-
 datafusion/sqllogictest/test_files/scalar.slt |  64 +-
 datafusion/sqllogictest/test_files/select.slt |  10 +-
 datafusion/sqllogictest/test_files/topk.slt   |  20 +-
 .../test_files/tpch/answers/q14.slt.part      |   2 +-
 .../test_files/tpch/answers/q17.slt.part      |   2 +-
 datafusion/sqllogictest/test_files/window.slt |  86 +--
 27 files changed, 963 insertions(+), 897 deletions(-)

diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index 58b34d248324..f8686432b5c8 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -16,7 +16,7 @@
 // under the License.
 
 use arrow::datatypes::{i256, Decimal128Type, Decimal256Type, DecimalType};
-use bigdecimal::BigDecimal;
+use bigdecimal::{BigDecimal, RoundingMode};
 use half::f16;
 use rust_decimal::prelude::*;
 
@@ -40,34 +40,18 @@ pub(crate) fn varchar_to_str(value: &str) -> String {
 }
 
 pub(crate) fn f16_to_str(value: f16) -> String {
-    if value.is_nan() {
-        // The sign of NaN can be different depending on platform.
-        // So the string representation of NaN ignores the sign.
-        "NaN".to_string()
-    } else if value == f16::INFINITY {
-        "Infinity".to_string()
-    } else if value == f16::NEG_INFINITY {
-        "-Infinity".to_string()
-    } else {
-        big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap())
-    }
+    float_to_str(value.into(), 4)
 }
 
 pub(crate) fn f32_to_str(value: f32) -> String {
-    if value.is_nan() {
-        // The sign of NaN can be different depending on platform.
-        // So the string representation of NaN ignores the sign.
-        "NaN".to_string()
-    } else if value == f32::INFINITY {
-        "Infinity".to_string()
-    } else if value == f32::NEG_INFINITY {
-        "-Infinity".to_string()
-    } else {
-        big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap())
-    }
+    float_to_str(value.into(), 6)
 }
 
 pub(crate) fn f64_to_str(value: f64) -> String {
+    float_to_str(value, 10)
+}
+
+fn float_to_str(value: f64, max_significant_digits: u8) -> String {
     if value.is_nan() {
         // The sign of NaN can be different depending on platform.
         // So the string representation of NaN ignores the sign.
@@ -77,79 +61,161 @@ pub(crate) fn f64_to_str(value: f64) -> String {
     } else if value == f64::NEG_INFINITY {
         "-Infinity".to_string()
     } else {
-        big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap())
+        let mut big_decimal = BigDecimal::from_f64(value)
+            .unwrap()
+            // Truncate trailing decimal zeros
+            .normalized();
+        let precision = big_decimal.digits();
+        if precision > max_significant_digits as u64 {
+            let scale = big_decimal.as_bigint_and_exponent().1;
+            big_decimal = big_decimal
+                .with_scale_round(
+                    scale + (max_significant_digits as i64 - precision as i64),
+                    RoundingMode::HalfUp,
+                )
+                // Truncate trailing decimal zeros
+                .normalized();
+        }
+        big_decimal.to_plain_string()
     }
 }
 
 pub(crate) fn decimal_128_to_str(value: i128, scale: i8) -> String {
     let precision = u8::MAX; // does not matter
-    big_decimal_to_str(
-        BigDecimal::from_str(&Decimal128Type::format_decimal(value, precision, scale))
-            .unwrap(),
-    )
+    BigDecimal::from_str(&Decimal128Type::format_decimal(value, precision, scale))
+        .unwrap()
+        .normalized() // Truncate trailing decimal zeros
+        .to_plain_string()
 }
 
 pub(crate) fn decimal_256_to_str(value: i256, scale: i8) -> String {
     let precision = u8::MAX; // does not matter
-    big_decimal_to_str(
-        BigDecimal::from_str(&Decimal256Type::format_decimal(value, precision, scale))
-            .unwrap(),
-    )
+    BigDecimal::from_str(&Decimal256Type::format_decimal(value, precision, scale))
+        .unwrap()
+        .normalized() // Truncate trailing decimal zeros
+        .to_plain_string()
 }
 
 #[cfg(feature = "postgres")]
 pub(crate) fn decimal_to_str(value: Decimal) -> String {
-    big_decimal_to_str(BigDecimal::from_str(&value.to_string()).unwrap())
-}
-
-pub(crate) fn big_decimal_to_str(value: BigDecimal) -> String {
-    // Round the value to limit the number of decimal places
-    let value = value.round(12).normalized();
-    // Format the value to a string
-    value.to_plain_string()
+    BigDecimal::from_str(&value.to_string())
+        .unwrap()
+        .normalized() // Truncate trailing decimal zeros
+        .to_plain_string()
 }
 
 #[cfg(test)]
 mod tests {
-    use super::big_decimal_to_str;
-    use bigdecimal::{num_bigint::BigInt, BigDecimal};
-
-    macro_rules! assert_decimal_str_eq {
-        ($integer:expr, $scale:expr, $expected:expr) => {
-            assert_eq!(
-                big_decimal_to_str(BigDecimal::from_bigint(
-                    BigInt::from($integer),
-                    $scale
-                )),
-                $expected
-            );
-        };
+    use super::*;
+    use half::f16;
+
+    #[test]
+    fn test_f16_to_str() {
+        assert_eq!(f16_to_str(f16::from_f32(0.)), "0");
+        assert_eq!(f16_to_str(f16::from_f32(1.)), "1");
+        assert_eq!(f16_to_str(f16::from_f32(12.345)), "12.34");
+        assert_eq!(f16_to_str(f16::from_f32(-12.345)), "-12.34");
+        assert_eq!(f16_to_str(f16::MAX), "65500");
+        assert_eq!(f16_to_str(f16::MIN), "-65500");
+        assert_eq!(f16_to_str(f16::EPSILON), "0.0009766");
+        assert_eq!(f16_to_str(f16::from_f32(f32::INFINITY)), "Infinity");
+        assert_eq!(f16_to_str(f16::from_f32(f32::NEG_INFINITY)), "-Infinity");
+        assert_eq!(f16_to_str(f16::from_f32(f32::NAN)), "NaN");
+    }
+
+    #[test]
+    fn test_f32_to_str() {
+        assert_eq!(f32_to_str(0.), "0");
+        assert_eq!(f32_to_str(1.), "1");
+        assert_eq!(f32_to_str(12.345), "12.345");
+        assert_eq!(f32_to_str(-12.345), "-12.345");
+        assert_eq!(f32_to_str(0.0000012345), "0.0000012345");
+        assert_eq!(f32_to_str(-0.0000012345), "-0.0000012345");
+        assert_eq!(f32_to_str(12.345678), "12.3457");
+        assert_eq!(f32_to_str(-12.345678), "-12.3457");
+        assert_eq!(
+            f32_to_str(f32::MAX),
+            "340282000000000000000000000000000000000"
+        );
+        assert_eq!(
+            f32_to_str(f32::MIN),
+            "-340282000000000000000000000000000000000"
+        );
+        assert_eq!(f32_to_str(f32::EPSILON), "0.000000119209");
+        assert_eq!(f32_to_str(f32::INFINITY), "Infinity");
+        assert_eq!(f32_to_str(f32::NEG_INFINITY), "-Infinity");
+        assert_eq!(f32_to_str(f32::NAN), "NaN");
+    }
+
+    #[test]
+    fn test_f64_to_str() {
+        assert_eq!(f64_to_str(0.), "0");
+        assert_eq!(f64_to_str(1.), "1");
+        assert_eq!(f64_to_str(12.345), "12.345");
+        assert_eq!(f64_to_str(-12.345), "-12.345");
+        assert_eq!(f64_to_str(12.345678), "12.345678");
+        assert_eq!(f64_to_str(-12.345678), "-12.345678");
+        assert_eq!(f64_to_str(0.00000000012345678), "0.00000000012345678");
+        assert_eq!(f64_to_str(-0.00000000012345678), "-0.00000000012345678");
+        assert_eq!(f64_to_str(12.34567890123456), "12.3456789");
+        assert_eq!(f64_to_str(-12.34567890123456), "-12.3456789");
+        assert_eq!(f64_to_str(0.99999999999999999999999), "1");
+        assert_eq!(f64_to_str(0.0000000000999999999999999), "0.0000000001");
+        assert_eq!(f64_to_str(f64::MAX), "179769313500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
+        assert_eq!(f64_to_str(f64::MIN), "-179769313500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
+        assert_eq!(f64_to_str(f64::EPSILON), "0.0000000000000002220446049");
+        assert_eq!(f64_to_str(f64::INFINITY), "Infinity");
+        assert_eq!(f64_to_str(f64::NEG_INFINITY), "-Infinity");
+        assert_eq!(f64_to_str(f64::NAN), "NaN");
+    }
+
+    #[test]
+    fn test_decimal_128_to_str() {
+        assert_eq!(decimal_128_to_str(1, 0), "1");
+        assert_eq!(decimal_128_to_str(1, 5), "0.00001");
+        assert_eq!(decimal_128_to_str(1, 20), "0.00000000000000000001");
+        assert_eq!(
+            decimal_128_to_str(1, 38),
+            "0.00000000000000000000000000000000000001"
+        );
+        assert_eq!(
+            decimal_128_to_str(12345678901234567890123456789012345678, 20),
+            "123456789012345678.90123456789012345678"
+        );
+        assert_eq!(
+            decimal_128_to_str(12345678901234567890123456789012345678, 0),
+            "12345678901234567890123456789012345678"
+        );
     }
 
     #[test]
-    fn test_big_decimal_to_str() {
-        assert_decimal_str_eq!(110, 3, "0.11");
-        assert_decimal_str_eq!(11, 3, "0.011");
-        assert_decimal_str_eq!(11, 2, "0.11");
-        assert_decimal_str_eq!(11, 1, "1.1");
-        assert_decimal_str_eq!(11, 0, "11");
-        assert_decimal_str_eq!(11, -1, "110");
-        assert_decimal_str_eq!(0, 0, "0");
-        assert_decimal_str_eq!(12345678901234567890123456789012345678_i128, 0, "12345678901234567890123456789012345678");
-        assert_decimal_str_eq!(12345678901234567890123456789012345678_i128, 38, "0.123456789012");
-
-        // Negative cases
-        assert_decimal_str_eq!(-110, 3, "-0.11");
-        assert_decimal_str_eq!(-11, 3, "-0.011");
-        assert_decimal_str_eq!(-11, 2, "-0.11");
-        assert_decimal_str_eq!(-11, 1, "-1.1");
-        assert_decimal_str_eq!(-11, 0, "-11");
-        assert_decimal_str_eq!(-11, -1, "-110");
-        assert_decimal_str_eq!(-12345678901234567890123456789012345678_i128, 0, "-12345678901234567890123456789012345678");
-        assert_decimal_str_eq!(-12345678901234567890123456789012345678_i128, 38, "-0.123456789012");
-
-        // Round to 12 decimal places
-        // 1.0000000000011 -> 1.000000000001
-        assert_decimal_str_eq!(10_i128.pow(13) + 11, 13, "1.000000000001");
+    fn test_decimal_256_to_str() {
+        assert_eq!(decimal_256_to_str(i256::from_str("1").unwrap(), 0), "1");
+        assert_eq!(
+            decimal_256_to_str(i256::from_str("1").unwrap(), 5),
+            "0.00001"
+        );
+        assert_eq!(
+            decimal_256_to_str(i256::from_str("1").unwrap(), 20),
+            "0.00000000000000000001"
+        );
+        assert_eq!(
+            decimal_256_to_str(i256::from_str("1").unwrap(), 38),
+            "0.00000000000000000000000000000000000001"
+        );
+        assert_eq!(
+            decimal_256_to_str(
+                i256::from_str("12345678901234567890123456789012345678").unwrap(),
+                20
+            ),
+            "123456789012345678.90123456789012345678"
+        );
+        assert_eq!(
+            decimal_256_to_str(
+                i256::from_str("12345678901234567890123456789012345678").unwrap(),
+                0
+            ),
+            "12345678901234567890123456789012345678"
+        );
     }
 }
diff --git a/datafusion/sqllogictest/test_files/aggregate.slt b/datafusion/sqllogictest/test_files/aggregate.slt
index e76c1466a547..82a518868d98 100644
--- a/datafusion/sqllogictest/test_files/aggregate.slt
+++ b/datafusion/sqllogictest/test_files/aggregate.slt
@@ -283,7 +283,7 @@ physical_plan
 query R
 SELECT avg(c12) FROM aggregate_test_100
 ----
-0.508972509913
+0.5089725099
 
 # csv_query_bit_and
 query IIIII
@@ -331,13 +331,13 @@ SELECT bit_xor(distinct c5 % 2) FROM aggregate_test_100
 query R
 SELECT covar_pop(c2, c12) FROM aggregate_test_100
 ----
--0.079169322354
+-0.07916932235
 
 # csv_query_covariance_2
 query R
 SELECT covar(c2, c12) FROM aggregate_test_100
 ----
--0.079969012479
+-0.07996901248
 
 # single_row_query_covar_1
 query R
@@ -381,13 +381,13 @@ with data as (
 select covar_samp(f, b), covar_pop(f, b)
 from data
 ----
-1 0.666666666667
+1 0.6666666667
 
 # csv_query_correlation
 query R
 SELECT corr(c2, c12) FROM aggregate_test_100
 ----
--0.190645441906
+-0.1906454419
 
 # single_row_query_correlation
 query R
@@ -437,19 +437,19 @@ SELECT var_pop(c2) FROM aggregate_test_100
 query R
 SELECT var_pop(c6) FROM aggregate_test_100
 ----
-26156334342021890000000000000000000000
+26156334340000000000000000000000000000
 
 # csv_query_variance_3
 query R
 SELECT var_pop(c12) FROM aggregate_test_100
 ----
-0.092342237216
+0.09234223722
 
 # csv_query_variance_4
 query R
 SELECT var(c2) FROM aggregate_test_100
 ----
-1.886363636364
+1.886363636
 
 # csv_query_distinct_variance
 query R
@@ -473,90 +473,90 @@ SELECT var_pop(c2), var_pop(distinct c2) FROM aggregate_test_100
 query R
 SELECT var_samp(c2) FROM aggregate_test_100
 ----
-1.886363636364
+1.886363636
 
 # csv_query_stddev_1
 query R
 SELECT stddev_pop(c2) FROM aggregate_test_100
 ----
-1.366565036872
+1.366565037
 
 # csv_query_stddev_2
 query R
 SELECT stddev_pop(c6) FROM aggregate_test_100
 ----
-5114326382039172000
+5114326382000000000
 
 # csv_query_stddev_3
 query R
 SELECT stddev_pop(c12) FROM aggregate_test_100
 ----
-0.303878655413
+0.3038786554
 
 # csv_query_stddev_4
 query R
 SELECT stddev(c12) FROM aggregate_test_100
 ----
-0.305409539941
+0.3054095399
 
 # csv_query_stddev_5
 query R
 SELECT stddev_samp(c12) FROM aggregate_test_100
 ----
-0.305409539941
+0.3054095399
 
 # csv_query_stddev_6
 query R
 select stddev(sq.column1) from (values (1.1), (2.0), (3.0)) as sq
 ----
-0.950438495292
+0.9504384953
 
 # csv_query_stddev_7
 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
+1 0.3036410323
+2 0.2845819674
+3 0.2960026605
+4 0.2843246091
+5 0.3310344868
 
 # 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
+1 0.2966598455
+2 0.2780389786
+3 0.2881078335
+4 0.2780749534
+5 0.3189928132
 
 # 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
+1 0.08800706391
+2 0.07730567362
+3 0.08300612371
+4 0.07732567972
+5 0.1017564149
 
 # 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
+1 0.09219787647
+2 0.08098689618
+3 0.08761757503
+4 0.08084048335
+5 0.1095838314
 
 # 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
+2 0.0007858782719
 3 NULL
 4 NULL
 5 0.000269544643
@@ -569,8 +569,8 @@ set datafusion.sql_parser.dialect = 'Postgres';
 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
+1 0.0007912434788
+2 0.0000615219026
 3 NULL
 4 NULL
 5 NULL
@@ -584,7 +584,7 @@ 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
+2 0.0007858782719
 3 NULL
 4 NULL
 5 0.000269544643
@@ -606,7 +606,7 @@ SELECT approx_median(c6) FROM aggregate_test_100
 query R
 SELECT approx_median(c12) FROM aggregate_test_100
 ----
-0.555006541052
+0.5550065411
 
 # csv_query_approx_median_4
 # test with string, approx median only supports numeric
@@ -629,7 +629,7 @@ SELECT median(c6) FROM aggregate_test_100
 query R
 SELECT median(c12) FROM aggregate_test_100
 ----
-0.551390054439
+0.5513900544
 
 # median_i8
 query I
@@ -1408,40 +1408,40 @@ 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 2 -15.33333333
 a 3 -4.5
 a 4 -32
 a 5 -32
-a NULL -18.333333333333
-b 1 31.666666666667
+a NULL -18.33333333
+b 1 31.66666667
 b 2 25.5
 b 3 -42
 b 4 -44.6
 b 5 -0.2
-b NULL -5.842105263158
+b NULL -5.842105263
 c 1 47.5
-c 2 -55.571428571429
+c 2 -55.57142857
 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
+c NULL -1.333333333
+d 1 -8.142857143
+d 2 109.3333333
+d 3 41.33333333
 d 4 54
 d 5 -49.5
-d NULL 25.444444444444
-e 1 75.666666666667
+d NULL 25.44444444
+e 1 75.66666667
 e 2 37.8
 e 3 48
-e 4 37.285714285714
+e 4 37.28571429
 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
+e NULL 40.33333333
+NULL 1 16.68181818
+NULL 2 8.363636364
+NULL 3 20.78947368
+NULL 4 1.260869565
+NULL 5 -13.85714286
 NULL NULL 7.81
 
 # csv_query_rollup_avg
@@ -1463,7 +1463,7 @@ a 3 -12 -9168
 a 3 13 22338.5
 a 3 14 28162
 a 3 17 -22796
-a 3 NULL 4958.833333333333
+a 3 NULL 4958.833333
 a 4 -101 11640
 a 4 -54 -2376
 a 4 -38 20744
@@ -1472,12 +1472,12 @@ 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
+a 5 NULL -14121.66667
+a NULL NULL 306.047619
 b 1 12 7652
 b 1 29 -18218
 b 1 54 -18410
-b 1 NULL -9658.666666666666
+b 1 NULL -9658.666667
 b 2 -60 -21739
 b 2 31 23127
 b 2 63 21456
@@ -1498,7 +1498,7 @@ b 5 -5 24896
 b 5 62 16337
 b 5 68 21576
 b 5 NULL 20135.4
-b NULL NULL 7732.315789473684
+b NULL NULL 7732.315789
 NULL NULL NULL 3833.525
 
 # csv_query_groupingsets_avg
@@ -1524,7 +1524,7 @@ a 3 -12 -9168
 a 3 13 22338.5
 a 3 14 28162
 a 3 17 -22796
-a 3 NULL 4958.833333333333
+a 3 NULL 4958.833333
 a 4 -101 11640
 a 4 -54 -2376
 a 4 -38 20744
@@ -1533,12 +1533,12 @@ 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
+a 5 NULL -14121.66667
+a NULL NULL 306.047619
 b 1 12 7652
 b 1 29 -18218
 b 1 54 -18410
-b 1 NULL -9658.666666666666
+b 1 NULL -9658.666667
 b 2 -60 -21739
 b 2 31 23127
 b 2 63 21456
@@ -1559,7 +1559,7 @@ b 5 -5 24896
 b 5 62 16337
 b 5 68 21576
 b 5 NULL 20135.4
-b NULL NULL 7732.315789473684
+b NULL NULL 7732.315789
 
 # csv_query_singlecol_with_rollup_avg
 query TIIR
@@ -1584,7 +1584,7 @@ a 3 -12 -9168
 a 3 13 22338.5
 a 3 14 28162
 a 3 17 -22796
-a 3 NULL 4958.833333333333
+a 3 NULL 4958.833333
 a 4 -101 11640
 a 4 -54 -2376
 a 4 -38 20744
@@ -1593,12 +1593,12 @@ 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
+a 5 NULL -14121.66667
+a NULL NULL 306.047619
 b 1 12 7652
 b 1 29 -18218
 b 1 54 -18410
-b 1 NULL -9658.666666666666
+b 1 NULL -9658.666667
 b 2 -60 -21739
 b 2 31 23127
 b 2 63 21456
@@ -1619,7 +1619,7 @@ b 5 -5 24896
 b 5 62 16337
 b 5 68 21576
 b 5 NULL 20135.4
-b NULL NULL 7732.315789473684
+b NULL NULL 7732.315789
 
 # csv_query_approx_percentile_cont_with_weight
 query TI
@@ -1872,51 +1872,51 @@ SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT
 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
+1 367 16.68181818 125 -99 22
+2 184 8.363636364 122 -117 22
+3 395 20.78947368 123 -101 19
+4 29 1.260869565 123 -117 23
+5 -194 -13.85714286 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 2 -46 -15.33333333 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
+a NULL -385 -18.33333333 83 -101 21
+b 1 95 31.66666667 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
+b NULL -111 -5.842105263 68 -117 19
 c 1 190 47.5 103 -24 4
-c 2 -389 -55.571428571429 29 -117 7
+c 2 -389 -55.57142857 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
+c NULL -28 -1.333333333 123 -117 21
+d 1 -57 -8.142857143 125 -99 7
+d 2 328 109.3333333 122 93 3
+d 3 124 41.33333333 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
+d NULL 458 25.44444444 125 -99 18
+e 1 227 75.66666667 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 4 261 37.28571429 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
+e NULL 847 40.33333333 120 -95 21
+NULL 1 367 16.68181818 125 -99 22
+NULL 2 184 8.363636364 122 -117 22
+NULL 3 395 20.78947368 123 -101 19
+NULL 4 29 1.260869565 123 -117 23
+NULL 5 -194 -13.85714286 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
@@ -2053,11 +2053,11 @@ 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
+0.01479305308 0.9965400388
+0.01479305308 0.980019341
+0.01479305308 0.9706712283
+0.2667177795 0.9965400388
+0.3600766362 0.9706712283
 
 # aggregate_min_max_with_custom_window_frames_unbounded_start
 query RR
@@ -2068,11 +2068,11 @@ 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
+0.01479305308 0.9965400388
+0.01479305308 0.980019341
+0.01479305308 0.980019341
+0.01479305308 0.9965400388
+0.01479305308 0.980019341
 
 # aggregate_avg_add
 query RRRR
@@ -2350,7 +2350,7 @@ create table t (c1 double, c2 double) as values (1, 4), (2, 5), (3, 6);
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.666666666667 Float64
+0.6666666667 Float64
 
 statement ok
 drop table t;
@@ -2374,7 +2374,7 @@ create table t (c1 double, c2 double) as values (1.1, 4.1), (2.0, 5.0), (3.0, 6.
 query RT
 select covar_samp(c1, c2), arrow_typeof(covar_samp(c1, c2)) from t;
 ----
-0.903333333333 Float64
+0.9033333333 Float64
 
 statement ok
 drop table t;
@@ -2386,7 +2386,7 @@ create table t (c1 double, c2 double) as values (1.1, 4.1), (2.0, 5.0), (3.0, 6.
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.602222222222 Float64
+0.6022222222 Float64
 
 statement ok
 drop table t;
@@ -2398,7 +2398,7 @@ create table t (c1 double, c2 double) as values (1.0, 4.0), (2.0, 5.0), (3.0, 6.
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.761666666667 Float64
+0.7616666667 Float64
 
 statement ok
 drop table t;
@@ -2410,7 +2410,7 @@ create table t (c1 int, c2 int) as values (1, 4), (2, 5), (3, 6);
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.666666666667 Float64
+0.6666666667 Float64
 
 statement ok
 drop table t;
@@ -2422,7 +2422,7 @@ create table t (c1 int unsigned, c2 int unsigned) as values (1, 4), (2, 5), (3,
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.666666666667 Float64
+0.6666666667 Float64
 
 statement ok
 drop table t;
@@ -2434,7 +2434,7 @@ create table t (c1 float, c2 float) as values (1, 4), (2, 5), (3, 6);
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.666666666667 Float64
+0.6666666667 Float64
 
 statement ok
 drop table t;
@@ -2458,7 +2458,7 @@ create table t (c1 int, c2 int) as values (1, 4), (null, 9), (2, 5), (null, 8),
 query RT
 select covar_pop(c1, c2), arrow_typeof(covar_pop(c1, c2)) from t;
 ----
-0.666666666667 Float64
+0.6666666667 Float64
 
 statement ok
 drop table t;
@@ -2554,7 +2554,7 @@ create table t (c1 double) as values (1.1), (2), (3);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-0.776029781788 Float64
+0.7760297818 Float64
 
 statement ok
 drop table t;
@@ -2566,7 +2566,7 @@ create table t (c1 double) as values (1), (2), (3), (4), (5);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-1.414213562373 Float64
+1.414213562 Float64
 
 statement ok
 drop table t;
@@ -2578,7 +2578,7 @@ create table t (c1 double) as values (1.1), (2), (3);
 query RT
 select stddev(c1), arrow_typeof(stddev(c1)) from t;
 ----
-0.950438495292 Float64
+0.9504384953 Float64
 
 statement ok
 drop table t;
@@ -2590,7 +2590,7 @@ create table t (c1 int) as values (1), (2), (3), (4), (5);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-1.414213562373 Float64
+1.414213562 Float64
 
 statement ok
 drop table t;
@@ -2602,7 +2602,7 @@ create table t (c1 int unsigned) as values (1), (2), (3), (4), (5);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-1.414213562373 Float64
+1.414213562 Float64
 
 statement ok
 drop table t;
@@ -2614,7 +2614,7 @@ create table t (c1 float) as values (1), (2), (3), (4), (5);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-1.414213562373 Float64
+1.414213562 Float64
 
 statement ok
 drop table t;
@@ -2638,7 +2638,7 @@ create table t (c1 int) as values (1), (null), (3), (4), (5);
 query RT
 select stddev_pop(c1), arrow_typeof(stddev_pop(c1)) from t;
 ----
-1.479019945775 Float64
+1.479019946 Float64
 
 statement ok
 drop table t;
@@ -2698,7 +2698,7 @@ create table t (c double) as values (1.1), (2), (3);
 query RT
 select var(c), arrow_typeof(var(c)) from t;
 ----
-0.903333333333 Float64
+0.9033333333 Float64
 
 statement ok
 drop table t;
@@ -2710,7 +2710,7 @@ create table t (c1 double) as values (1.1), (2), (3);
 query RT
 select var(c1), arrow_typeof(var(c1)) from t;
 ----
-0.903333333333 Float64
+0.9033333333 Float64
 
 statement ok
 drop table t;
@@ -3054,7 +3054,7 @@ NULL 0 NULL 0
 query RRRR
 select var(sq.column1), var_pop(sq.column1), stddev(sq.column1), stddev_pop(sq.column1) from (values (1.0), (3.0)) as sq;
 ----
-2 1 1.414213562373 1
+2 1 1.414213562 1
 
 
 
@@ -4569,7 +4569,7 @@ create table t (c float) as values (1.2), (0.2), (-1.2), (null), (-1.0);
 query RT
 select sum(c), arrow_typeof(sum(c)) from t;
 ----
--0.79999999702 Float64
+-0.799999997 Float64
 
 statement ok
 drop table t;
@@ -4852,7 +4852,7 @@ query R
 select avg(x_dict) from value_dict group by x_dict % 2 order by avg(x_dict);
 ----
 2.6
-2.666666666667
+2.666666667
 
 query I
 select min(x_dict) from value_dict group by x_dict % 2 order by min(x_dict);
@@ -5220,7 +5220,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
+0.05153400263 0.4842735535 100 0.001929150558 0.4792749482 0.5089725099 6.707779293 9.234223722 0.3456787157
 
 
 
@@ -5308,7 +5308,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
+0.05153400263 0.4842735535 100 0.001929150558 0.4792749482 0.5089725099 6.707779293 9.234223722 0.3456787157
 
 statement ok
 set datafusion.execution.batch_size = 2;
@@ -5326,7 +5326,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
+0.05153400263 0.4842735535 100 0.001929150558 0.4792749482 0.5089725099 6.707779293 9.234223722 0.3456787157
 
 statement ok
 set datafusion.execution.batch_size = 3;
@@ -5344,7 +5344,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
+0.05153400263 0.4842735535 100 0.001929150558 0.4792749482 0.5089725099 6.707779293 9.234223722 0.3456787157
 
 statement ok
 set datafusion.execution.batch_size = 8192;
@@ -5369,8 +5369,8 @@ WINDOW w AS (ORDER BY column1 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW);
 NULL NULL 1 NULL 1 2 0 0 0
 2 0 2 1 1.5 3 0.5 2 1
 2 0 3 1 2 4 2 8 4
-4 -4.666666666667 3 0.923076923077 3 7.333333333333 2 34.666666666667 8
-4.5 -7 3 0.964285714286 4 11 2 42 9
+4 -4.666666667 3 0.9230769231 3 7.333333333 2 34.66666667 8
+4.5 -7 3 0.9642857143 4 11 2 42 9
 3 0 3 1 5 15 2 18 6
 
 query RRIRRRRRR
@@ -5503,7 +5503,7 @@ drop table string_agg_large_utf8;
 query RRRRI
 select min(col_f32), max(col_f32), avg(col_f32), sum(col_f32), count(col_f32) from float_table;
 ----
--128.2 32768.3 10889.13359451294 32667.40078353882 3
+-128.2 32768.3 10889.13359 32667.40078 3
 
 query RRRRI
 select min(col_f32_nan), max(col_f32_nan), avg(col_f32_nan), sum(col_f32_nan), count(col_f32_nan) from float_table;
@@ -5513,7 +5513,7 @@ select min(col_f32_nan), max(col_f32_nan), avg(col_f32_nan), sum(col_f32_nan), c
 query RRRRI
 select min(col_f64), max(col_f64), avg(col_f64), sum(col_f64), count(col_f64) from float_table;
 ----
--128.2 32768.3 10889.133333333333 32667.4 3
+-128.2 32768.3 10889.13333 32667.4 3
 
 query RRRRI
 select min(col_f64_nan), max(col_f64_nan), avg(col_f64_nan), sum(col_f64_nan), count(col_f64_nan) from float_table;
@@ -6074,7 +6074,7 @@ FROM data
 GROUP BY k
 ORDER BY k;
 ----
-1 1.8125 6.8007813 Float16 Float16
+1 1.813 6.801 Float16 Float16
 2 8.5 8.5 Float16 Float16
 
 statement ok
diff --git a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
index a2e51cffacf7..b39d36b777d6 100644
--- a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
+++ b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
@@ -251,41 +251,41 @@ SELECT c2, count(c1), count(c5), count(c11) FROM aggregate_test_100 GROUP BY c2
 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
+1 -1991133944 2143473091 0.0644532 0.896519
+2 -2138770630 2053379412 0.0550649 0.831591
+3 -2141999138 2030965207 0.0342919 0.948803
+4 -1885422396 2064155045 0.028003 0.745987
+5 -2117946883 2025611582 0.125593 0.8799
 
 # 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
+1 -438598674 12.15325379
+2 -8259865364 9.577824473
+3 1956035476 9.590891361
+4 16155718643 9.531112969
+5 6449337880 7.074412227
 
 # 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
+1 23971150 0.592261
+2 -562486880 0.434221
+3 240273900 0.401997
+4 762932956 0.48515
+5 604973998 0.498424
 
 # 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
+1 191655437 0.599267
+2 -587831330 0.432305
+3 240273900 0.401997
+4 762932956 0.48515
+5 593204320 0.515659
 
 # Test approx_distinct for varchar / int
 query III
@@ -311,41 +311,41 @@ SELECT c2, count(c3), count(c11) FROM aggregate_test_100_null GROUP BY c2 ORDER
 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
+1 -99 125 0.0644532 0.896519
+2 -117 122 0.0968372 0.831591
+3 -101 123 0.0342919 0.946696
+4 -117 123 0.028003 0.708509
+5 -101 118 0.125593 0.8799
 
 # 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
+1 367 12.15325379
+2 184 9.577824473
+3 395 9.590891361
+4 29 9.531112969
+5 -194 7.074412227
 
 # 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
+1 12 0.606794
+2 1 0.460765
+3 14 0.40154
+4 -17 0.48515
+5 -35 0.553664
 
 # 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
+1 12 0.606794
+2 1 0.460765
+3 14 0.40154
+4 -7 0.48515
+5 -39 0.553664
 
 # Test approx_distinct with nullable fields
 query II
@@ -365,11 +365,11 @@ 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
+a 2.857142857 0.4382234216
+b 3.263157895 0.4964812084
+c 2.666666667 0.4252411383
+d 2.444444444 0.5415194763
+e 3 0.5054402635
 
 # FIXME: add bool_and(v3) column when issue fixed
 # ISSUE https://github.com/apache/datafusion/issues/11846
@@ -506,11 +506,11 @@ 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
+a 2.5 0.4490718875
+b 2.642857143 0.4454862986
+c 2.421052632 0.4228821177
+d 2.125 0.5187061913
+e 2.789473684 0.5367853234
 
 # Test count with nullable fields and nullable filter
 query III
@@ -534,11 +534,11 @@ 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
+1 -99 103 0.257847 0.896519
+2 -48 93 0.0968372 0.831591
+3 -76 123 0.0342919 0.946696
+4 -117 123 0.06564 0.57361
+5 -94 68 0.125593 0.75173
 
 # Test min / max with nullable fields and nullable filter
 query III
@@ -562,11 +562,11 @@ 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
+1 -3 77 7.214695632 5.085060358
+2 100 77 6.197732747 3.150197089
+3 109 211 2.80575043 2.80632931
+4 -171 56 2.107405066 1.939846396
+5 -86 -76 1.874171019 1.600569308
 
 # Test approx_distinct with nullable fields and filter
 query II
@@ -599,11 +599,11 @@ 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
+1 -5 0.662372
+2 15 0.529307
+3 13 0.327925
+4 -38 0.497748
+5 -18 0.498424
 
 # Test min / max with nullable fields and nullable filter
 query II
@@ -624,11 +624,11 @@ 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
+1 -5 0.662372
+2 12 0.529307
+3 13 0.327925
+4 -38 0.497748
+5 -21 0.476527
 
 # Test approx_median with nullable fields and nullable filter
 query II
diff --git a/datafusion/sqllogictest/test_files/array.slt b/datafusion/sqllogictest/test_files/array.slt
index 7578692ddb0f..25b93e1b3bc7 100644
--- a/datafusion/sqllogictest/test_files/array.slt
+++ b/datafusion/sqllogictest/test_files/array.slt
@@ -4967,26 +4967,26 @@ select list_distance([1, 2, 3], [1, 2, 3]) AS distance;
 query RRR
 select array_distance(column1, column2), array_distance(column1, column3), array_distance(column1, column4) from arrays_distance_table;
 ----
-0 0.374165738677 NULL
-5.196152422707 6.063827174318 NULL
-10.392304845413 11.778794505381 NULL
-15.58845726812 15.935494971917 NULL
+0 0.3741657387 NULL
+5.196152423 6.063827174 NULL
+10.39230485 11.77879451 NULL
+15.58845727 15.93549497 NULL
 
 query RRR
 select array_distance(column1, column2), array_distance(column1, column3), array_distance(column1, column4) from large_arrays_distance_table;
 ----
-0 0.374165738677 NULL
-5.196152422707 6.063827174318 NULL
-10.392304845413 11.778794505381 NULL
-15.58845726812 15.935494971917 NULL
+0 0.3741657387 NULL
+5.196152423 6.063827174 NULL
+10.39230485 11.77879451 NULL
+15.58845727 15.93549497 NULL
 
 query RRR
 select array_distance(column1, column2), array_distance(column1, column3), array_distance(column1, column4) from fixed_size_arrays_distance_table;
 ----
-0 0.374165738677 NULL
-5.196152422707 6.063827174318 NULL
-10.392304845413 11.778794505381 NULL
-15.58845726812 15.935494971917 NULL
+0 0.3741657387 NULL
+5.196152423 6.063827174 NULL
+10.39230485 11.77879451 NULL
+15.58845727 15.93549497 NULL
 
 
 ## array_dims (aliases: `list_dims`)
diff --git a/datafusion/sqllogictest/test_files/clickbench.slt b/datafusion/sqllogictest/test_files/clickbench.slt
index dfcd92475857..c4a821d4df68 100644
--- a/datafusion/sqllogictest/test_files/clickbench.slt
+++ b/datafusion/sqllogictest/test_files/clickbench.slt
@@ -52,7 +52,7 @@ SELECT SUM("AdvEngineID"), COUNT(*), AVG("ResolutionWidth") FROM hits;
 query R
 SELECT AVG("UserID") FROM hits;
 ----
--304548765855551740
+-304548765900000000
 
 query I
 SELECT COUNT(DISTINCT "UserID") FROM hits;
diff --git a/datafusion/sqllogictest/test_files/ddl.slt b/datafusion/sqllogictest/test_files/ddl.slt
index 4a0ba87bfa1a..739c8b26cb1a 100644
--- a/datafusion/sqllogictest/test_files/ddl.slt
+++ b/datafusion/sqllogictest/test_files/ddl.slt
@@ -461,7 +461,7 @@ 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
+c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 10 0.110831 0.9294097332 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW
 
 
 
diff --git a/datafusion/sqllogictest/test_files/decimal.slt b/datafusion/sqllogictest/test_files/decimal.slt
index f082a79c5508..1110d0ed2d57 100644
--- a/datafusion/sqllogictest/test_files/decimal.slt
+++ b/datafusion/sqllogictest/test_files/decimal.slt
@@ -584,7 +584,7 @@ Decimal128(12, 2) 400420638.54
 query TR
 select arrow_typeof(cast(400420638.54 as decimal(12,2)) * 1.0), cast(400420638.54 as decimal(12,2)) * 1.0;
 ----
-Float64 400420638.54
+Float64 400420638.5
 
 
 query TB
diff --git a/datafusion/sqllogictest/test_files/distinct_on.slt b/datafusion/sqllogictest/test_files/distinct_on.slt
index cc0ebf83a843..047c1d263bd1 100644
--- a/datafusion/sqllogictest/test_files/distinct_on.slt
+++ b/datafusion/sqllogictest/test_files/distinct_on.slt
@@ -148,9 +148,9 @@ LIMIT 3;
 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
+a 1 -85 -15154 1171968280 1919439543497968449 77 52286 774637006 12101411955859039553 0.122852 0.6864391963 0keZ5G8BffGwgF2RwQD59TFzMStxCB
+b 1 29 -18218 994303988 5983957848665088916 204 9489 3275293996 14857091259186476033 0.538404 0.1790903512 AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz
+c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 5863949479783605708 0.110831 0.9294097332 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW
 
 # can't distinct on *
 query error DataFusion error: SQL error: ParserError\("Expected: an expression, found: \*"\)
diff --git a/datafusion/sqllogictest/test_files/expr.slt b/datafusion/sqllogictest/test_files/expr.slt
index 2306eda77d35..94ef00f81d0e 100644
--- a/datafusion/sqllogictest/test_files/expr.slt
+++ b/datafusion/sqllogictest/test_files/expr.slt
@@ -1742,25 +1742,25 @@ CREATE TABLE doubles (
 query RRR rowsort
 select f64, round(1.0 / f64) as i64_1, acos(round(1.0 / f64)) from doubles;
 ----
-10.1 0 1.570796326795
+10.1 0 1.570796327
 
 # common subexpr with coalesce (short-circuited)
 query RRR
 select f64, coalesce(1.0 / f64, 0.0), acos(coalesce(1.0 / f64, 0.0)) from doubles;
 ----
-10.1 0.09900990099 1.471623942989
+10.1 0.09900990099 1.471623943
 
 # common subexpr with coalesce (short-circuited) and alias
 query RRR
 select f64, coalesce(1.0 / f64, 0.0) as f64_1, acos(coalesce(1.0 / f64, 0.0)) from doubles;
 ----
-10.1 0.09900990099 1.471623942989
+10.1 0.09900990099 1.471623943
 
 # common subexpr with case (short-circuited)
 query RRR rowsort
 select f64, case when f64 > 0 then 1.0 / f64 else null end, acos(case when f64 > 0 then 1.0 / f64 else null end) from doubles;
 ----
-10.1 0.09900990099 1.471623942989
+10.1 0.09900990099 1.471623943
 
 
 statement ok
diff --git a/datafusion/sqllogictest/test_files/expr/date_part.slt b/datafusion/sqllogictest/test_files/expr/date_part.slt
index cec80a165f30..2079e5331f30 100644
--- a/datafusion/sqllogictest/test_files/expr/date_part.slt
+++ b/datafusion/sqllogictest/test_files/expr/date_part.slt
@@ -490,12 +490,12 @@ SELECT extract(nanosecond from arrow_cast('23:32:50.123456'::time, 'Time64(Micro
 query R
 SELECT date_part('epoch', arrow_cast('23:32:50.123456'::time, 'Time64(Microsecond)'))
 ----
-84770.123456
+84770.12346
 
 query R
 SELECT extract(epoch from arrow_cast('23:32:50.123456'::time, 'Time64(Microsecond)'))
 ----
-84770.123456
+84770.12346
 
 ## time64 nanoseconds
 query I
@@ -570,19 +570,19 @@ SELECT date_part('nanosecond', arrow_cast('23:32:50.123456789'::time, 'Time64(Na
 query R
 SELECT date_part('epoch', arrow_cast('23:32:50.123456789'::time, 'Time64(Nanosecond)'))
 ----
-84770.123456789
+84770.12346
 
 query R
 SELECT extract(epoch from arrow_cast('23:32:50.123456789'::time, 'Time64(Nanosecond)'))
 ----
-84770.123456789
+84770.12346
 
 # test_extract_epoch
 
 query R
 SELECT extract(epoch from '1870-01-01T07:29:10.256'::timestamp)
 ----
--3155646649.744
+-3155646650
 
 query R
 SELECT extract(epoch from '2000-01-01T00:00:00.000'::timestamp)
diff --git a/datafusion/sqllogictest/test_files/functions.slt b/datafusion/sqllogictest/test_files/functions.slt
index 4b770a19fe20..9f392db8c65c 100644
--- a/datafusion/sqllogictest/test_files/functions.slt
+++ b/datafusion/sqllogictest/test_files/functions.slt
@@ -337,17 +337,17 @@ OPTIONS ('format.has_header' 'true');
 query R
 SELECT avg(sqrt(c11)) FROM aggregate_test_100
 ----
-0.658440848589
+0.6584408486
 
 query R
 SELECT avg(CAST(sqrt(c11) AS double)) FROM aggregate_test_100
 ----
-0.658440848589
+0.6584408486
 
 query R
 SELECT avg(sqrt(CAST(c11 AS double))) FROM aggregate_test_100
 ----
-0.658440848342
+0.6584408483
 
 statement ok
 drop table aggregate_test_100
@@ -372,12 +372,12 @@ create table t as values (
 query R
 SELECT sqrt(column1) FROM t
 ----
-1.414213562373
+1.414213562
 
 query R
 SELECT SQRT(column1) FROM t
 ----
-1.414213562373
+1.414213562
 
 statement error Error during planning: Invalid function 'SQRT'
 SELECT "SQRT"(column1) FROM t
@@ -385,13 +385,13 @@ SELECT "SQRT"(column1) FROM t
 query R
 SELECT "sqrt"(column1) FROM t
 ----
-1.414213562373
+1.414213562
 
 # case_builtin_math_expression
 query RRRRRRRRRR
 SELECT sqrt(column1),sqrt(column2),sqrt(column3),sqrt(column4),sqrt(column5),sqrt(column6),sqrt(column7),sqrt(column8),sqrt(column9),sqrt(column10) FROM t
 ----
-1.414213562373 1.414213562373 1.414213562373 1.414213562373 1.414213562373 1.414213562373 1.414213562373 1.414213562373 1.4142135 1.414213562373
+1.414213562 1.414213562 1.414213562 1.414213562 1.414213562 1.414213562 1.414213562 1.414213562 1.41421 1.414213562
 
 statement ok
 drop table t
@@ -834,7 +834,7 @@ SELECT greatest(-1, 1, 2.3, 123456789, 3 + 5, -(-4))
 query R
 SELECT greatest(-1.123, 1.21313, 2.3, 123456789.321, 3 + 5.3213, -(-4.3213), abs(-9))
 ----
-123456789.321
+123456789.3
 
 query R
 SELECT greatest(-1, 1, 2.3, 123456789, 3 + 5, -(-4), abs(-9.0))
diff --git a/datafusion/sqllogictest/test_files/group.slt b/datafusion/sqllogictest/test_files/group.slt
index a6b5f9b72a53..cb5288162ae3 100644
--- a/datafusion/sqllogictest/test_files/group.slt
+++ b/datafusion/sqllogictest/test_files/group.slt
@@ -43,11 +43,11 @@ 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
+1 0.05636955102 0.9965400388
+2 0.1630111052 0.9915178287
+3 0.04734343429 0.9293883502
+4 0.02182578039 0.9237877978
+5 0.01479305308 0.9723580397
 
 # csv_query_group_by_float32
 query IR
@@ -137,21 +137,21 @@ e
 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
+a 0.4875451747
+b 0.4104070926
+c 0.6600456536
+d 0.4885537939
+e 0.4860066927
 
 # 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
+a 0.4875451747
+b 0.4104070926
+c 0.6600456536
+d 0.4885537939
+e 0.4860066927
 
 # csv_query_group_by_int_count
 query TI rowsort
@@ -177,11 +177,11 @@ e 21
 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
+a 0.02182578039 0.980019341
+b 0.04893135682 0.9185813971
+c 0.04949244655 0.9915178287
+d 0.06102937535 0.9748360509
+e 0.01479305308 0.9965400388
 
 
 # Create a table containing null values
@@ -356,11 +356,11 @@ 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
+a 0.4875451747
+b 0.4104070926
+c 0.6600456536
+d 0.4885537939
+e 0.4860066927
 
 # csv_query_group_by_order_by_substr_aliased_projection
 query TR
@@ -369,11 +369,11 @@ 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
+a 0.4875451747
+b 0.4104070926
+c 0.6600456536
+d 0.4885537939
+e 0.4860066927
 
 # csv_query_group_by_order_by_avg_group_by_substr
 query TR
@@ -382,8 +382,8 @@ 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
+b 0.4104070926
+e 0.4860066927
+a 0.4875451747
+d 0.4885537939
+c 0.6600456536
diff --git a/datafusion/sqllogictest/test_files/join.slt b/datafusion/sqllogictest/test_files/join.slt
index 1feacc5ebe53..5489c7112d1b 100644
--- a/datafusion/sqllogictest/test_files/join.slt
+++ b/datafusion/sqllogictest/test_files/join.slt
@@ -1001,13 +1001,13 @@ CREATE TABLE t3 (v0 DOUBLE) AS VALUES (0.05112015193508901);
 query RR
 SELECT t3.v0, t2.v0 FROM t1,t2,t3 WHERE t3.v0 >= t1.v0;
 ----
-0.051120151935 -1.663563947387
+0.05112015194 -1.663563947
 
 # Test issue: https://github.com/apache/datafusion/issues/11414
 query IRR
 SELECT * FROM t1 INNER JOIN t2 ON NULL RIGHT JOIN t3 ON TRUE;
 ----
-NULL NULL 0.051120151935
+NULL NULL 0.05112015194
 
 # ON expression must be boolean type
 query error DataFusion error: type_coercion\ncaused by\nError during planning: Join condition must be boolean type, but got Utf8
diff --git a/datafusion/sqllogictest/test_files/joins.slt b/datafusion/sqllogictest/test_files/joins.slt
index 49aaa877caa6..3199d2ce5676 100644
--- a/datafusion/sqllogictest/test_files/joins.slt
+++ b/datafusion/sqllogictest/test_files/joins.slt
@@ -861,7 +861,7 @@ ORDER BY a.population
 ----
 c 626.443 c 626.443
 a 838.698 a 838.698
-b 1778.934 b 1778.934
+b 1778.93 b 1778.93
 
 statement ok
 DROP TABLE population;
diff --git a/datafusion/sqllogictest/test_files/math.slt b/datafusion/sqllogictest/test_files/math.slt
index e86d78a62353..51857e88d7a1 100644
--- a/datafusion/sqllogictest/test_files/math.slt
+++ b/datafusion/sqllogictest/test_files/math.slt
@@ -92,7 +92,7 @@ SELECT round(125.2345, -3), round(125.2345, -2), round(125.2345, -1), round(125.
 query RRRRRRR
 SELECT atan2(2.0, 1.0), atan2(-2.0, 1.0), atan2(2.0, -1.0), atan2(-2.0, -1.0), atan2(NULL, 1.0), atan2(2.0, NULL), atan2(NULL, NULL);
 ----
-1.107148717794 -1.107148717794 2.034443935796 -2.034443935796 NULL NULL NULL
+1.107148718 -1.107148718 2.034443936 -2.034443936 NULL NULL NULL
 
 # nanvl
 query RRR
diff --git a/datafusion/sqllogictest/test_files/options.slt b/datafusion/sqllogictest/test_files/options.slt
index aafaa054964e..7c656c88fe51 100644
--- a/datafusion/sqllogictest/test_files/options.slt
+++ b/datafusion/sqllogictest/test_files/options.slt
@@ -101,7 +101,7 @@ query IIRIIIR
 select 0, -9223372036854775808, -9223372036854775809, 9223372036854775807, 
     9223372036854775808, 18446744073709551615, 18446744073709551616
 ----
-0 -9223372036854775808 -9223372036854776000 9223372036854775807 9223372036854775808 18446744073709551615 18446744073709552000
+0 -9223372036854775808 -9223372037000000000 9223372036854775807 9223372036854775808 18446744073709551615 18446744070000000000
 
 query TTTTTTT
 select arrow_typeof(0), arrow_typeof(-9223372036854775808), arrow_typeof(-9223372036854775809),  
diff --git a/datafusion/sqllogictest/test_files/order.slt b/datafusion/sqllogictest/test_files/order.slt
index a46040aa532e..a699b0c6905e 100644
--- a/datafusion/sqllogictest/test_files/order.slt
+++ b/datafusion/sqllogictest/test_files/order.slt
@@ -57,7 +57,7 @@ SELECT id FROM alltypes_plain ORDER BY int_col, double_col
 query R
 SELECT MIN(c12) FROM aggregate_test_100 ORDER BY MIN(c12)
 ----
-0.014793053078
+0.01479305308
 
 # test_nulls_first_asc
 
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 25b4924715ca..369633c6af91 100644
--- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt
+++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_simple.slt
@@ -81,7 +81,7 @@ SELECT
   cos(4.0) as cos,
   tan(5.0) as tan;
 ----
-1.1 7.389056098931 0.14112000806 -0.653643620864 -3.380515006247
+1.1 7.3890560989306502 0.1411200081 -0.6536436209 -3.380515006
 
 
 query I
@@ -356,11 +356,11 @@ 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
+1 367 16.6818181818181818 125 -99 22 0 -1 -47
+2 184 8.3636363636363636 122 -117 22 0 -1 -2
+3 395 20.7894736842105263 123 -101 19 0 -1 101
+4 29 1.2608695652173913 123 -117 23 0 -1 15
+5 -194 -13.8571428571428571 118 -101 14 0 -1 -122
 
 
 query I
@@ -477,106 +477,106 @@ 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
+a 1 -85 -15154 1171968280 1919439543497968449 77 52286 774637006 12101411955859039553 0.122852 0.6864391963 0keZ5G8BffGwgF2RwQD59TFzMStxCB
+a 1 -56 8692 2106705285 -7811675384226570375 231 15573 1454057357 677091006469429514 0.427948 0.2739938529 JN0VclewmjwYlSl8386MlWv5rEhWCz
+a 1 -25 15295 383352709 4980135132406487265 231 102 3276123488 12763583666216333412 0.537963 0.1759248691 XemNcT1xp61xcM1Qz3wZ1VECCnq06O
+a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.298778 0.2537253408 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs
+a 1 83 -14704 2143473091 -4387559599038777245 37 829 4015442341 4602675983996931623 0.895425 0.9567595541 ErJFw6hzZ5fmI5r8bhE4JzlscnhKZU
+a 2 -48 -18025 439738328 -313657814587041987 222 13763 3717551163 9135746610908713318 0.0550649 0.980019341 ukyD7b0Efj7tNlFSRmzZ0IqkEzg2a8
+a 2 -43 13080 370975815 5881039805148485053 2 20120 2939920218 906367167997372130 0.427338 0.1630111052 m6jD0LBIQWaMfenwRCTANI9eOdyyto
+a 2 45 15673 -1899175111 398282800995316041 99 2555 145294611 8554426087132697832 0.173333 0.640526243 b3b9esRhTzFEawbs6XhpKnD9ojutHB
+a 3 -72 -11122 -2141451704 -2578916903971263854 83 30296 1995343206 17452974532402389080 0.942093 0.323175061 e2Gh6Ov8XkXoFdJWhl0EjwEHlMDYyG
+a 3 -12 -9168 1489733240 -1569376002217735076 206 33821 3959216334 16060348691054629425 0.948803 0.9293883502 oLZ21P2JEDooxV1pU31cIxQHEeeoLu
+a 3 13 12613 1299719633 2020498574254265315 191 17835 3998790955 14881411008939145569 0.0414454 0.8813167498 Amn2K87Db5Es3dFQO9cw9cvpAM6h35
+a 3 13 32064 912707948 3826618523497875379 42 21463 2214035726 10771380284714693539 0.613347 0.7325106679 i6RQVXKUh7MzuGMDaNclUYnFUAireU
+a 3 14 28162 397430452 -452851601758273256 57 14722 431948861 8164671015278284913 0.401997 0.07260475961 TtDKUZxzVxsq758G6AWPSYuZgVgbcl
+a 3 17 -22796 1337043149 -1282905594104562444 167 2809 754775609 732272194388185106 0.388413 0.658671129 VDhtJkYjAYPykCgOU9x3v7v3t4SO1a
+a 4 -101 11640 1993193190 2992662416070659899 230 40566 466439833 16778113360088370541 0.399112 0.5742108382 NEhyk8uIx4kEULJGa8qIyFjjBcP2G6
+a 4 -54 -2376 434021400 5502271306323260832 113 15777 2502326480 7966148640299601101 0.572093 0.3058537515 KJFcmTVjdkCMv94wYCtfHMFhzyRsmH
+a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.745987 0.02182578039 ydkwycaISlYSlEq3TlkS2m15I2pcp8
+a 4 65 -28462 -1813935549 7602389238442209730 18 363 1865307672 11378396836996498283 0.091302 0.5593249815 WHmjWk2AY4c6m7DA4GitUx6nmb1yYS
+a 5 -101 -12484 -842693467 -6140627905445351305 57 57885 2496054700 2243924747182709810 0.595206 0.9491397433 QJYm7YRA3YetcBHI5wkMZeLXVmfuNy
+a 5 -31 -12907 586844478 -4862189775214031241 170 28086 1013876852 11005002152861474932 0.353192 0.05573662213 MeSTAXq8gVxVjbEjgkvU9YLte0X9uE
+a 5 36 -16974 623103518 6834444206535996609 71 29458 141047417 17448660630302620693 0.171 0.04429073092 OF7fQ37GzaZ5ikA2oMyvleKtgnLjXh
+b 1 12 7652 -1448995523 -5332734971209541785 136 49283 4076864659 15449267433866484283 0.621458 0.05636955102 akiiY5N0I44CMwEnBL6RTBk7BRkxEj
+b 1 29 -18218 994303988 5983957848665088916 204 9489 3275293996 14857091259186476033 0.538404 0.1790903512 AyYVExXK6AR2qUTxNZ7qRHQOVGMLcz
+b 1 54 -18410 1413111008 -7145106120930085900 249 5382 1842680163 17818611040257178339 0.888119 0.2489979431 6FPJlLAcaQ5uokyOWZ9HGdLZObFvOZ
+b 2 -60 -21739 -1908480893 -8897292622858103761 59 50009 2525744318 1719090662556698549 0.529307 0.5603331886 l7uwDoTepWwnAP0ufqtHJS3CRi7RfP
+b 2 31 23127 -800561771 -8706387435232961848 153 27034 1098639440 3343692635488765507 0.356927 0.5590205548 okOkcWflkNXIy4R8LzmySyY1EC3sYd
+b 2 63 21456 -2138770630 -2380041687053733364 181 57594 2705709344 13144161537396946288 0.0968372 0.3051364089 nYVJnVicpGRqKZibHyBAmtmzBXAFfT
+b 2 68 15874 49866617 1179733259727844435 121 23948 3455216719 3898128009708892708 0.630625 0.9185813971 802bgTGl6Bk5TlkPYYTxp5JkKyaYUA
+b 3 -101 -13217 -346989627 5456800329302529236 26 54276 243203849 17929716297117857676 0.0542218 0.09465635124 MXhhH1Var3OzzJCtI9VNyYvA0q8UyJ
+b 3 17 14457 670497898 -2390782464845307388 255 24770 1538863055 12662506238151717757 0.340776 0.7614304101 6x93sxYioWuq5c9Kkk8oTAAORM7cH0
+b 4 -117 19316 2051224722 -5534418579506232438 133 52046 3023531799 13684453606722360110 0.626088 0.8506721053 mhjME0zBHbrK6NMkytMTQzOssOa1gF
+b 4 -111 -1967 -4229382 1892872227362838079 67 9832 1243785310 8382489916947120498 0.06564 0.152498293 Sfx0vxv1skzZWT1PqVdoRDdO6Sb6xH
+b 4 -59 25286 1423957796 2646602445954944051 0 61069 3570297463 15100310750150419896 0.496194 0.04893135682 fuyvs0w7WsKSlXqJ1e6HFSoLmx03AG
+b 4 17 -28070 -673237643 1904316899655860234 188 27744 933879086 3732692885824435932 0.418601 0.403422832 JHNgc2UCaiXOdmkxwDDyGhRlO0mnBQ
+b 4 47 20690 -1009656194 -2027442591571700798 200 7781 326151275 2881913079548128905 0.57361 0.2145232647 52mKlRE3aHCBZtjECq6sY9OqVf8Dze
+b 5 -82 22080 1824882165 7373730676428214987 208 34331 3342719438 3330177516592499461 0.826346 0.4097538353 Ig1QcuKsjHXkproePdERo2w0mYzIqd
+b 5 -44 15788 -629486480 5822642169425315613 13 11872 3457053821 2413406423648025909 0.443183 0.3286937469 ALuRhobVWbnQTTWZdSOk0iVe8oYFhW
+b 5 -5 24896 1955646088 2430204191283109071 118 43655 2424630722 11429640193932435507 0.8799 0.7328050041 JafwVLSVk5AVoXFuzclesQ000EE2k1
+b 5 62 16337 41423756 -2274773899098124524 121 34206 2307004493 10575647935385523483 0.237948 0.1754261587 qnPOOmslCJaT45buUisMRnM0rc77EK
+b 5 68 21576 1188285940 5717755781990389024 224 27600 974297360 9865419128970328044 0.808957 0.7973920073 ioEncce3mPOXD2hWhpZpCPWGATG6GU
+c 1 -24 -24085 -1882293856 7385529783747709716 41 48048 520189543 2402288956117186783 0.397615 0.3600766362 Fi4rJeTQq4eXj8Lxg3Hja5hBVTVV5u
+c 1 41 -4667 -644225469 7049620391314639084 196 48099 2125812933 15419512479294091215 0.578074 0.9255031346 mzbkwXKrPeZnxg2Kn1LRF5hYSsmksS
+c 1 70 27752 1325868318 1241882478563331892 63 61637 473294098 4976799313755010034 0.138016 0.5081765563 Ktb7GQ0N1DrxwkCkEUsTaIXk0xYinn
+c 1 103 -22186 431378678 1346564663822463162 146 12393 3766999078 10901819591635583995 0.0644532 0.7784918984 2T3wSlHdEmASmO0xcXHnndkKEt6bz8
+c 2 -117 -30187 -1222533990 -191957437217035800 136 47061 2293105904 12659011877190539078 0.204738 0.9706712283 pLk3i59bZwd5KBZrI1FiweYTd5hteG
+c 2 -107 -2904 -1011669561 782342092880993439 18 29527 1157161427 4403623840168496677 0.319884 0.369363046 QYlaIAnJA6r8rlAb6f59wcxvcPcWFf
+c 2 -106 -1114 -1927628110 1080308211931669384 177 20421 141680161 7464432081248293405 0.567491 0.5653528422 Vp3gmWunM5A7wOC9YW2JroFqTWjvTi
+c 2 -60 -16312 -1808210365 -3368300253197863813 71 39635 2844041986 7045482583778080653 0.805363 0.6425694115 BJqx5WokrmrrezZA0dUbleMYkG5U2O
+c 2 -29 25305 -537142430 -7683452043175617798 150 31648 598822671 11759014161799384683 0.831591 0.9463251649 9UbObCsVkmYpJGcGrgfK90qOnwb2Lj
+c 2 1 18109 2033001162 -6513304855495910254 25 43062 1491205016 5863949479783605708 0.110831 0.9294097332 6WfVFBVGJSQb7FhA7E0lBwdvjfZnSW
+c 2 29 -3855 1354539333 4742062657200940467 81 53815 3398507249 562977550464243101 0.712453 0.9915178287 Oq6J4Rx6nde0YlhOIJkFsX2MsSvAQ0
+c 3 -2 -18655 -2141999138 -3154042970870838072 251 34970 3862393166 13062025193350212516 0.0342919 0.7697753383 IWl0G3ZlMNf7WT8yjIB49cx7MmYOmr
+c 3 22 13741 -2098805236 8604102724776612452 45 2516 1362369177 196777795886465166 0.946696 0.04949244655 6oIXZuIPIqEoPBvFmbt2Nxy3tryGUE
+c 3 73 -9565 -382483011 1765659477910680019 186 1535 1088543984 2906943497598597237 0.680652 0.6009475545 Ow5PGpfTm4dXCfTDsXAOTatXRoAydR
+c 3 97 29106 -903316089 2874859437662206732 207 42171 3473924576 8188072741116415408 0.327925 0.2667177795 HKSMQ9nTnwXCJIte1JrM1dtYnDtJ8g
+c 4 -90 -2935 1579876740 6733733506744649678 254 12876 3593959807 4094315663314091142 0.570869 0.5603062368 Ld2ej8NEv5zNcqU60FwpHeZKBhfpiV
+c 4 -79 5281 -237425046 373011991904079451 121 55620 2818832252 2464584078983135763 0.497748 0.9237877978 t6fQUjJejPcjc04wHvHTPe55S65B4V
+c 4 3 -30508 659422734 -6455460736227846736 133 59663 2306130875 8622584762448622224 0.169999 0.4273123319 EcCuckwsF3gV1Ecgmh5v4KM8g1ozif
+c 4 123 16620 852509237 -3087630526856906991 196 33715 3566741189 4546434653720168472 0.0760699 0.8197158651 8LIh0b6jmDGm87BmIyjdxNIpX4ugjD
+c 5 -94 -15880 2025611582 -3348824099853919681 5 40622 4268716378 12849419495718510869 0.341639 0.4830878559 RilTlL1tKkPOUFuzmLydHAVZwv1OGl
+c 5 118 19208 -134213907 -2120241105523909127 86 57751 1229567292 16493024289408725403 0.553664 0.9723580397 TTQUwpMNSXZqVBKAFvXu7OlWvKXJKX
+d 1 -99 5613 1213926989 -8863698443222021480 19 18736 4216440507 14933742247195536130 0.606794 0.3363959066 aDxBtor7Icd9C5hnTvvw5NrIre740e
+d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.896519 0.1640882545 y7C453hRWd4E7ImjNDWlpexB8nUqjh
+d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.419806 0.2153540234 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS
+d 1 -8 27138 -1383162419 7682021027078563072 36 64517 2861376515 9904216782086286050 0.809545 0.9463098244 AFGCj7OWlEB5QfniEFgonMq90Tq5uH
+d 1 38 18384 -335410409 -1632237090406591229 26 57510 2712615025 1842662804748246269 0.606448 0.6404495093 4HX6feIvmNXBN7XGqgO4YVBkhu8GDI
+d 1 57 28781 -1143802338 2662536767954229885 202 62167 879082834 4338034436871150616 0.761838 0.4295052173 VY0zXmXeksCT8BzvpzpPLbmU9Kp9Y4
+d 1 125 31106 -1176490478 -4306856842351827308 90 17910 3625286410 17869394731126786457 0.888251 0.763123907 dVdvo6nUD5FgCgsbOZLds28RyGTpnx
+d 2 93 -12642 2053379412 6468763445799074329 147 50842 1000948272 5536487915963301239 0.427927 0.2853442858 lqhzgLsXZ8JhtpeeUWWNbMz8PHI705
+d 2 113 3917 -108973366 -7220140168410319165 197 24380 63044568 4225581724448081782 0.118671 0.2944158618 90gAtmGEeIqUTbo1ZrxCvWtsseukXC
+d 2 122 10130 -168758331 -3179091803916845592 30 794 4061635107 15695681119022625322 0.695925 0.9748360509 OPwBqCEK5PWTjWaiOyL45u2NLTaDWv
+d 3 -76 8809 141218956 -9110406195556445909 58 5494 1824517658 12046662515387914426 0.855729 0.6668423897 Z2sWcQr0qyCJRMHDpRy3aQr7PkHtkK
+d 3 77 15091 -1302295658 8795481303066536947 154 35477 2093538928 17419098323248948387 0.119529 0.7035635283 O66j6PaYuZhEUtqV6fuU7TyjM2WxC5
+d 3 123 29533 240273900 1176001466590906949 117 30972 2592330556 12883447461717956514 0.390751 0.3887028098 1aOcrEGd0cOqZe2I5XBOm0nDcwtBZO
+d 4 5 -7688 702611616 6239356364381313700 4 39363 3126475872 35363005357834672 0.376693 0.06102937535 H5j5ZHy1FGesOAHjkQEDYCucbpKWRu
+d 4 55 -1471 1902023838 1252101628560265705 157 3691 811650497 1524771507450695976 0.29687 0.543759554 f9ALCzwDAKmdu7Rk2msJaB1wxe5IBX
+d 4 102 -24558 1991172974 -7823479531661596016 14 36599 1534194097 2240998421986827216 0.028003 0.8824879448 0og6hSkhbX8AC1ktFS4kounvTzy8Vo
+d 5 -59 2045 -2117946883 1170799768349713170 189 63353 1365198901 2501626630745849169 0.75173 0.1862885927 F7NSTjWvQJyBburN7CXRUlbgp2dIrA
+d 5 -40 22614 706441268 -7542719935673075327 155 14337 3373581039 11720144131976083864 0.696321 0.311471254 C2GT5KVyOPZpgKVl110TyZO0NcJ434
+e 1 36 -21481 -928766616 -3471238138418013024 150 52569 2610290479 7788847578701297242 0.257847 0.7670021786 gpo8K5qtYePve6jyPt6xgJx4YOVjms
+e 1 71 -5479 -1339586153 -3920238763788954243 123 53012 4229654142 10297218950720052365 0.73473 0.5773498217 cBGc0kSm32ylBDnxogG727C0uhZEYZ
+e 1 120 10837 -1331533190 6342019705133850847 245 3975 2830981072 16439861276703750332 0.662372 0.9965400388 LiEBxds3X0Uw0lxiYjDqrkAaAwoiIW
+e 2 -61 -2888 -1660426473 2553892468492435401 126 35429 4144173353 939909697866979632 0.440514 0.9231889897 BPtQMxnuSPpxMExYV9YkDa6cAN7GP3
+e 2 49 24495 -587831330 9178511478067509438 129 12757 1289293657 10948666249269100825 0.561008 0.5991138115 bgK1r6v3BCTh0aejJUhkA1Hn6idXGp
+e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.669477 0.3914443657 xipQ93429ksjNcXPX5326VSg1xJZcW
+e 2 52 23388 715235348 605432070100399212 165 56980 3314983189 7386391799827871203 0.460765 0.9808096313 jQimhdepw3GKmioWUlVSWeBVRKFkY3
+e 2 97 18167 1593800404 -9112448817105133638 163 45185 3188005828 2792105417953811674 0.381754 0.4094218354 ukOiFGGFnQJDHFgZxHMpvhD3zybF0M
+e 3 -95 13611 2030965207 927403809957470678 119 59134 559847112 10966649192992996919 0.530129 0.04734343429 gTpyQnEODMcpsPnJMZC66gh33i3m0b
+e 3 71 194 1436496767 -5639533800082367925 158 44507 3105312559 3998472996619161534 0.930117 0.6108938308 pTeu0WMjBRTaNRT15rLCuEh3tBJVc5
+e 3 104 -25136 1738331255 300633854973581194 139 20807 3577318119 13079037564113702254 0.40154 0.776436099 DuJNG8tufSqW0ZstHqWj3aGvFLMg4A
+e 3 112 -6823 -421042466 8535335158538929274 129 32712 3759340273 9916295859593918600 0.642434 0.6316565297 BsM5ZAYifRh5Lw3Y8X1r53I0cTJnfE
+e 4 -56 -31500 1544188174 3096047390018154410 220 417 557517119 2774306934041974261 0.154596 0.1911329358 IZTkHMLvIKuiLjhDjYMmIHxh166we4
+e 4 -53 13788 2064155045 -691093532952651300 243 35106 2778168728 9463973906560740422 0.345152 0.2715919052 0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm
+e 4 30 -16110 61035129 -3356533792537910152 159 299 28774375 13526465947516666293 0.699978 0.03968347086 cq4WSAIFwx3wwTUS5bp1wCe71R6U5I
+e 4 73 -22501 1282464673 2541794052864382235 67 21119 538589788 9575476605699527641 0.48515 0.2960365387 4JznSdBajNWhu4hRQwjV1FjTTxY68i
+e 4 74 -12612 -1885422396 1702850374057819332 130 3583 3198969145 10767179755613315144 0.551806 0.5614503755 QEHVvcP8gxI6EMJIrvcnIhgzPNjIvv
+e 4 96 -30336 427197269 7506304308750926996 95 48483 3521368277 5437030162957481122 0.581043 0.4207312533 3BEOHQsMEFZ58VcNTOJYShTBpAPzbt
+e 4 97 -13181 2047637360 6176835796788944083 158 53000 2042457019 9726016502640071617 0.708509 0.1235753999 oHJMNvWuunsIMIWFnYG31RCfkOo2V7
+e 5 -86 32514 -467659022 -8012578250188146150 254 2684 2861911482 2126626171973341689 0.125593 0.01479305308 gxfHWUF8XgY2KdFxigxvNEXe2V2XMl
+e 5 64 -26526 1689098844 8950618259486183091 224 45253 662099130 16127995415060805595 0.289732 0.5759450484 56MZa5O1hVtX4c5sbnCfxuX5kDChqI
 
 # distinct_from logic for floats
 query BBBBBBBBBBB
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 edad3747a203..96291a9ceebc 100644
--- a/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt
+++ b/datafusion/sqllogictest/test_files/pg_compat/pg_compat_window.slt
@@ -704,92 +704,92 @@ 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
+225513085 1 6 16.6818181818181818 367 125 -99 0 -1 -47
+473294098 2 11 16.6818181818181818 367 125 -99 0 -1 -47
+520189543 3 12 16.6818181818181818 367 125 -99 0 -1 -47
+774637006 4 19 16.6818181818181818 367 125 -99 0 -1 -47
+879082834 5 21 16.6818181818181818 367 125 -99 0 -1 -47
+1454057357 6 34 16.6818181818181818 367 125 -99 0 -1 -47
+1842680163 7 40 16.6818181818181818 367 125 -99 0 -1 -47
+2125812933 8 46 16.6818181818181818 367 125 -99 0 -1 -47
+2610290479 9 56 16.6818181818181818 367 125 -99 0 -1 -47
+2669374863 10 57 16.6818181818181818 367 125 -99 0 -1 -47
+2712615025 11 59 16.6818181818181818 367 125 -99 0 -1 -47
+2830981072 12 62 16.6818181818181818 367 125 -99 0 -1 -47
+2861376515 13 64 16.6818181818181818 367 125 -99 0 -1 -47
+3275293996 14 72 16.6818181818181818 367 125 -99 0 -1 -47
+3276123488 15 73 16.6818181818181818 367 125 -99 0 -1 -47
+3542840110 16 82 16.6818181818181818 367 125 -99 0 -1 -47
+3625286410 17 87 16.6818181818181818 367 125 -99 0 -1 -47
+3766999078 18 90 16.6818181818181818 367 125 -99 0 -1 -47
+4015442341 19 94 16.6818181818181818 367 125 -99 0 -1 -47
+4076864659 20 96 16.6818181818181818 367 125 -99 0 -1 -47
+4216440507 21 98 16.6818181818181818 367 125 -99 0 -1 -47
+4229654142 22 99 16.6818181818181818 367 125 -99 0 -1 -47
+63044568 23 2 12.5227272727272727 551 125 -117 0 -1 47
+141680161 24 4 12.5227272727272727 551 125 -117 0 -1 47
+145294611 25 5 12.5227272727272727 551 125 -117 0 -1 47
+598822671 26 16 12.5227272727272727 551 125 -117 0 -1 47
+1000948272 27 24 12.5227272727272727 551 125 -117 0 -1 47
+1098639440 28 27 12.5227272727272727 551 125 -117 0 -1 47
+1157161427 29 28 12.5227272727272727 551 125 -117 0 -1 47
+1289293657 30 31 12.5227272727272727 551 125 -117 0 -1 47
+1491205016 31 35 12.5227272727272727 551 125 -117 0 -1 47
+2013662838 32 43 12.5227272727272727 551 125 -117 0 -1 47
+2293105904 33 48 12.5227272727272727 551 125 -117 0 -1 47
+2525744318 34 54 12.5227272727272727 551 125 -117 0 -1 47
+2705709344 35 58 12.5227272727272727 551 125 -117 0 -1 47
+2844041986 36 63 12.5227272727272727 551 125 -117 0 -1 47
+2939920218 37 66 12.5227272727272727 551 125 -117 0 -1 47
+3188005828 38 70 12.5227272727272727 551 125 -117 0 -1 47
+3314983189 39 74 12.5227272727272727 551 125 -117 0 -1 47
+3398507249 40 77 12.5227272727272727 551 125 -117 0 -1 47
+3455216719 41 78 12.5227272727272727 551 125 -117 0 -1 47
+3717551163 42 88 12.5227272727272727 551 125 -117 0 -1 47
+4061635107 43 95 12.5227272727272727 551 125 -117 0 -1 47
+4144173353 44 97 12.5227272727272727 551 125 -117 0 -1 47
+243203849 45 7 15.0158730158730159 946 125 -117 0 -1 74
+431948861 46 9 15.0158730158730159 946 125 -117 0 -1 74
+559847112 47 15 15.0158730158730159 946 125 -117 0 -1 74
+754775609 48 18 15.0158730158730159 946 125 -117 0 -1 74
+1088543984 49 26 15.0158730158730159 946 125 -117 0 -1 74
+1362369177 50 32 15.0158730158730159 946 125 -117 0 -1 74
+1538863055 51 37 15.0158730158730159 946 125 -117 0 -1 74
+1824517658 52 39 15.0158730158730159 946 125 -117 0 -1 74
+1995343206 53 42 15.0158730158730159 946 125 -117 0 -1 74
+2093538928 54 45 15.0158730158730159 946 125 -117 0 -1 74
+2214035726 55 47 15.0158730158730159 946 125 -117 0 -1 74
+2592330556 56 55 15.0158730158730159 946 125 -117 0 -1 74
+3105312559 57 68 15.0158730158730159 946 125 -117 0 -1 74
+3473924576 58 80 15.0158730158730159 946 125 -117 0 -1 74
+3577318119 59 85 15.0158730158730159 946 125 -117 0 -1 74
+3759340273 60 89 15.0158730158730159 946 125 -117 0 -1 74
+3862393166 61 91 15.0158730158730159 946 125 -117 0 -1 74
+3959216334 62 92 15.0158730158730159 946 125 -117 0 -1 74
+3998790955 63 93 15.0158730158730159 946 125 -117 0 -1 74
+28774375 64 1 11.3372093023255814 975 125 -117 0 -1 69
+326151275 65 8 11.3372093023255814 975 125 -117 0 -1 69
+466439833 66 10 11.3372093023255814 975 125 -117 0 -1 69
+538589788 67 13 11.3372093023255814 975 125 -117 0 -1 69
+557517119 68 14 11.3372093023255814 975 125 -117 0 -1 69
+811650497 69 20 11.3372093023255814 975 125 -117 0 -1 69
+933879086 70 22 11.3372093023255814 975 125 -117 0 -1 69
+1243785310 71 30 11.3372093023255814 975 125 -117 0 -1 69
+1534194097 72 36 11.3372093023255814 975 125 -117 0 -1 69
+1787652631 73 38 11.3372093023255814 975 125 -117 0 -1 69
+1865307672 74 41 11.3372093023255814 975 125 -117 0 -1 69
+2042457019 75 44 11.3372093023255814 975 125 -117 0 -1 69
+2306130875 76 49 11.3372093023255814 975 125 -117 0 -1 69
+2502326480 77 53 11.3372093023255814 975 125 -117 0 -1 69
+2778168728 78 60 11.3372093023255814 975 125 -117 0 -1 69
+2818832252 79 61 11.3372093023255814 975 125 -117 0 -1 69
+3023531799 80 67 11.3372093023255814 975 125 -117 0 -1 69
+3126475872 81 69 11.3372093023255814 975 125 -117 0 -1 69
+3198969145 82 71 11.3372093023255814 975 125 -117 0 -1 69
+3521368277 83 81 11.3372093023255814 975 125 -117 0 -1 69
+3566741189 84 83 11.3372093023255814 975 125 -117 0 -1 69
+3570297463 85 84 11.3372093023255814 975 125 -117 0 -1 69
+3593959807 86 86 11.3372093023255814 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
@@ -821,106 +821,106 @@ 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
+28774375 1 23 1.2608695652173913 29 123 -117 0 -1 15
+63044568 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+141047417 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+141680161 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+145294611 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+225513085 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+243203849 1 19 20.7894736842105263 395 123 -101 0 -1 101
+326151275 1 23 1.2608695652173913 29 123 -117 0 -1 15
+431948861 1 19 20.7894736842105263 395 123 -101 0 -1 101
+466439833 1 23 1.2608695652173913 29 123 -117 0 -1 15
+473294098 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+520189543 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+538589788 1 23 1.2608695652173913 29 123 -117 0 -1 15
+557517119 1 23 1.2608695652173913 29 123 -117 0 -1 15
+559847112 1 19 20.7894736842105263 395 123 -101 0 -1 101
+598822671 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+662099130 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+754775609 1 19 20.7894736842105263 395 123 -101 0 -1 101
+774637006 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+811650497 1 23 1.2608695652173913 29 123 -117 0 -1 15
+879082834 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+933879086 1 23 1.2608695652173913 29 123 -117 0 -1 15
+974297360 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+1000948272 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+1013876852 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+1088543984 1 19 20.7894736842105263 395 123 -101 0 -1 101
+1098639440 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+1157161427 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+1229567292 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+1243785310 1 23 1.2608695652173913 29 123 -117 0 -1 15
+1289293657 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+1362369177 1 19 20.7894736842105263 395 123 -101 0 -1 101
+1365198901 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+1454057357 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+1491205016 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+1534194097 1 23 1.2608695652173913 29 123 -117 0 -1 15
+1538863055 1 19 20.7894736842105263 395 123 -101 0 -1 101
+1787652631 1 23 1.2608695652173913 29 123 -117 0 -1 15
+1824517658 1 19 20.7894736842105263 395 123 -101 0 -1 101
+1842680163 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+1865307672 1 23 1.2608695652173913 29 123 -117 0 -1 15
+1995343206 1 19 20.7894736842105263 395 123 -101 0 -1 101
+2013662838 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+2042457019 1 23 1.2608695652173913 29 123 -117 0 -1 15
+2093538928 1 19 20.7894736842105263 395 123 -101 0 -1 101
+2125812933 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2214035726 1 19 20.7894736842105263 395 123 -101 0 -1 101
+2293105904 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+2306130875 1 23 1.2608695652173913 29 123 -117 0 -1 15
+2307004493 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+2424630722 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+2496054700 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+2502326480 1 23 1.2608695652173913 29 123 -117 0 -1 15
+2525744318 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+2592330556 1 19 20.7894736842105263 395 123 -101 0 -1 101
+2610290479 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2669374863 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2705709344 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+2712615025 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2778168728 1 23 1.2608695652173913 29 123 -117 0 -1 15
+2818832252 1 23 1.2608695652173913 29 123 -117 0 -1 15
+2830981072 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2844041986 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+2861376515 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+2861911482 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+2939920218 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3023531799 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3105312559 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3126475872 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3188005828 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3198969145 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3275293996 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+3276123488 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+3314983189 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3342719438 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+3373581039 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+3398507249 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3455216719 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3457053821 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
+3473924576 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3521368277 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3542840110 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+3566741189 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3570297463 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3577318119 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3593959807 1 23 1.2608695652173913 29 123 -117 0 -1 15
+3625286410 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+3717551163 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+3759340273 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3766999078 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+3862393166 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3959216334 1 19 20.7894736842105263 395 123 -101 0 -1 101
+3998790955 1 19 20.7894736842105263 395 123 -101 0 -1 101
+4015442341 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+4061635107 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+4076864659 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+4144173353 1 22 8.3636363636363636 184 122 -117 0 -1 -2
+4216440507 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+4229654142 1 22 16.6818181818181818 367 125 -99 0 -1 -47
+4268716378 1 14 -13.8571428571428571 -194 118 -101 0 -1 -122
 
 
 query IIIRIIIIII
@@ -942,102 +942,102 @@ ORDER BY c9;
 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
+145294611 3 3 17.3333333333333333 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
+520189543 3 3 -17.3333333333333333 -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
+559847112 3 3 -60.6666666666666667 -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
+933879086 7 7 9.2857142857142857 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
+1157161427 7 7 5.7142857142857143 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
+1362369177 6 6 -11.6666666666666667 -70 73 -101 0 -1 122
+1365198901 6 6 32.6666666666666667 196 118 -59 0 -9 114
+1454057357 6 6 -22.6666666666666667 -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
+1534194097 9 9 6.2222222222222222 56 102 -111 0 -1 -6
+1538863055 7 7 -7.5714285714285714 -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
+1842680163 7 7 -11.7142857142857143 -82 70 -98 0 -1 92
+1865307672 11 11 7.5454545454545455 83 102 -111 0 -1 97
+1995343206 9 9 -22.3333333333333333 -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
+2214035726 11 11 -10.0909090909090909 -111 77 -101 0 -1 39
+2293105904 11 11 2.2727272727272727 25 113 -117 0 -1 113
+2306130875 13 13 14.0769230769230769 183 102 -111 0 -1 3
+2307004493 7 7 36.8571428571428571 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
+2496054700 9 9 16.8888888888888889 152 118 -101 0 -1 44
+2502326480 14 14 9.2142857142857143 129 102 -111 0 -1 -55
+2525744318 12 12 -2.9166666666666667 -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
+2610290479 9 9 -0.55555555555555555556 -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
+2705709344 13 13 2.1538461538461538 28 113 -117 0 -1 -118
+2712615025 11 11 2.5454545454545455 28 70 -98 0 -1 -116
+2778168728 15 15 5.0666666666666667 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
+2830981072 12 12 12.3333333333333333 148 120 -98 0 -1 -12
+2844041986 14 14 -2.2857142857142857 -32 113 -117 0 -1 78
+2861376515 13 13 10.7692307692307692 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
+3023531799 17 17 -7.0588235294117647 -120 102 -117 0 -1 56
+3105312559 13 13 6.3846153846153846 83 123 -101 0 -1 27
+3126475872 18 18 -6.3888888888888889 -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
+3198969145 19 19 -2.1578947368421053 -41 102 -117 0 -1 119
+3275293996 14 14 12.0714285714285714 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
+3314983189 17 17 4.3529411764705882 74 113 -117 0 -1 -50
+3342719438 11 11 -1.4545454545454545 -16 118 -101 0 -1 40
+3373581039 12 12 -4.6666666666666667 -56 118 -101 0 -1 -16
+3398507249 18 18 5.7222222222222222 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
+3457053821 13 13 -7.6923076923076923 -100 118 -101 0 -1 36
+3473924576 14 14 12.8571428571428571 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
+3566741189 21 21 8.4761904761904762 178 123 -117 0 -1 108
+3570297463 22 22 5.4090909090909091 119 123 -117 0 -1 -87
+3577318119 15 15 18.9333333333333333 284 123 -101 0 -1 18
+3593959807 23 23 1.2608695652173913 29 123 -117 0 -1 15
+3625286410 17 17 11.5882352941176471 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
+3766999078 18 18 16.6666666666666667 300 125 -98 0 -1 84
+3862393166 17 17 23.1764705882352941 394 123 -101 0 -1 -100
+3959216334 18 18 21.2222222222222222 382 123 -101 0 -1 104
+3998790955 19 19 20.7894736842105263 395 123 -101 0 -1 101
+4015442341 19 19 20.1578947368421053 383 125 -98 0 -1 7
+4061635107 21 21 11.6666666666666667 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
+4144173353 22 22 8.3636363636363636 184 122 -117 0 -1 -2
+4216440507 21 21 14.0952380952380952 296 125 -99 0 -1 -106
+4229654142 22 22 16.6818181818181818 367 125 -99 0 -1 -47
+4268716378 14 14 -13.8571428571428571 -194 118 -101 0 -1 -122
 
 
 query IIIIIIIIII
@@ -1167,106 +1167,106 @@ 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
+28774375 0.6086956522 14 14 0.5909090909
+63044568 0.9545454545 21 19 0.9523809524
+141047417 0.7142857143 10 10 0.6923076923
+141680161 0.1363636364 3 3 0.09523809524
+145294611 0.5909090909 13 12 0.5714285714
+225513085 0.09090909091 2 2 0.04761904762
+243203849 0.05263157895 1 1 0
+326151275 0.652173913 15 15 0.6363636364
+431948861 0.4736842105 9 8 0.4444444444
+466439833 0.1304347826 3 3 0.09090909091
+473294098 0.7727272727 17 17 0.7619047619
+520189543 0.3181818182 7 7 0.2857142857
+538589788 0.7826086957 18 18 0.7727272727
+557517119 0.3043478261 7 7 0.2727272727
+559847112 0.1052631579 2 2 0.05555555556
+598822671 0.4090909091 9 8 0.380952381
+662099130 0.8571428571 12 12 0.8461538462
+754775609 0.5789473684 10 9 0.5
+774637006 0.1363636364 3 3 0.09523809524
+811650497 0.6956521739 16 16 0.6818181818
+879082834 0.7272727273 16 16 0.7142857143
+933879086 0.5652173913 13 13 0.5454545455
+974297360 0.9285714286 13 13 0.9230769231
+1000948272 0.8636363636 19 17 0.8571428571
+1013876852 0.5714285714 8 8 0.5384615385
+1088543984 0.7368421053 14 12 0.7222222222
+1098639440 0.5454545455 12 11 0.5238095238
+1157161427 0.09090909091 2 2 0.04761904762
 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
+1243785310 0.08695652174 2 2 0.04545454545
+1289293657 0.6363636364 14 13 0.619047619
+1362369177 0.6315789474 12 10 0.6111111111
+1365198901 0.3571428571 5 5 0.3076923077
+1454057357 0.2272727273 5 5 0.1904761905
+1491205016 0.4545454545 10 9 0.4285714286
+1534194097 0.9565217391 22 22 0.9545454545
+1538863055 0.5789473684 10 9 0.5
+1787652631 0.4347826087 10 10 0.4090909091
+1824517658 0.1578947368 3 3 0.1111111111
+1842680163 0.6818181818 15 15 0.6666666667
+1865307672 0.7391304348 17 17 0.7272727273
+1995343206 0.2105263158 4 4 0.1666666667
+2013662838 0.7272727273 15 14 0.6666666667
+2042457019 0.9130434783 21 21 0.9090909091
+2093538928 0.7894736842 15 13 0.7777777778
+2125812933 0.6363636364 14 14 0.619047619
+2214035726 0.4210526316 7 7 0.3333333333
+2293105904 0.04545454545 1 1 0
+2306130875 0.4782608696 11 11 0.4545454545
+2307004493 0.7857142857 11 11 0.7692307692
+2424630722 0.6428571429 9 9 0.6153846154
+2496054700 0.07142857143 1 1 0
+2502326480 0.347826087 8 8 0.3181818182
+2525744318 0.2727272727 5 5 0.1904761905
 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
+2610290479 0.5454545455 12 12 0.5238095238
+2669374863 0.4090909091 9 9 0.380952381
+2705709344 0.7727272727 17 15 0.7619047619
+2712615025 0.5909090909 13 13 0.5714285714
+2778168728 0.3913043478 9 9 0.3636363636
+2818832252 0.2173913043 5 5 0.1818181818
+2830981072 0.9545454545 21 21 0.9523809524
+2844041986 0.2727272727 5 5 0.1904761905
+2861376515 0.3636363636 8 8 0.3333333333
+2861911482 0.2142857143 3 3 0.1538461538
+2939920218 0.3636363636 8 7 0.3333333333
 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
+3105312559 0.6842105263 13 11 0.6666666667
+3126475872 0.5217391304 12 12 0.5
+3188005828 0.9090909091 20 18 0.9047619048
+3198969145 0.8260869565 19 19 0.8181818182
+3275293996 0.5 11 11 0.4761904762
+3276123488 0.2727272727 6 6 0.2380952381
+3314983189 0.7272727273 15 14 0.6666666667
+3342719438 0.2857142857 4 4 0.2307692308
+3373581039 0.5 7 7 0.4615384615
+3398507249 0.5 11 10 0.4761904762
+3455216719 0.8181818182 18 16 0.8095238095
+3457053821 0.4285714286 6 6 0.3846153846
+3473924576 0.8421052632 16 14 0.8333333333
+3521368277 0.8695652174 20 20 0.8636363636
+3542840110 0.1818181818 4 4 0.1428571429
 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
+3570297463 0.2608695652 6 6 0.2272727273
+3577318119 0.8947368421 17 15 0.8888888889
+3593959807 0.1739130435 4 4 0.1363636364
 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
+3717551163 0.3181818182 7 6 0.2857142857
+3759340273 0.9473684211 18 16 0.9444444444
+3766999078 0.9090909091 20 20 0.9047619048
+3862393166 0.3157894737 6 6 0.2777777778
+3959216334 0.2631578947 5 5 0.2222222222
+3998790955 0.4210526316 7 7 0.3333333333
+4015442341 0.8636363636 19 19 0.8571428571
 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
+4076864659 0.4545454545 10 10 0.4285714286
+4144173353 0.1818181818 4 4 0.1428571429
+4216440507 0.04545454545 1 1 0
+4229654142 0.8181818182 18 18 0.8095238095
+4268716378 0.1428571429 2 2 0.07692307692
 
 
 query IIIIIII
diff --git a/datafusion/sqllogictest/test_files/predicates.slt b/datafusion/sqllogictest/test_files/predicates.slt
index 878d7c8a4dfb..092946c5bd21 100644
--- a/datafusion/sqllogictest/test_files/predicates.slt
+++ b/datafusion/sqllogictest/test_files/predicates.slt
@@ -50,8 +50,8 @@ 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
+e 0.3914443657
+d 0.3887028098
 
 # async fn csv_query_with_negative_predicate
 query TI
diff --git a/datafusion/sqllogictest/test_files/projection.slt b/datafusion/sqllogictest/test_files/projection.slt
index b5bcb5b4c6f7..53de42a9ee12 100644
--- a/datafusion/sqllogictest/test_files/projection.slt
+++ b/datafusion/sqllogictest/test_files/projection.slt
@@ -89,11 +89,11 @@ 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
+0.4104070926 b
+0.4860066927 e
+0.4875451747 a
+0.4885537939 d
+0.6600456536 c
 
 # parallel projection
 query II
diff --git a/datafusion/sqllogictest/test_files/scalar.slt b/datafusion/sqllogictest/test_files/scalar.slt
index fe7d1a90c5bd..db7ec13db942 100644
--- a/datafusion/sqllogictest/test_files/scalar.slt
+++ b/datafusion/sqllogictest/test_files/scalar.slt
@@ -93,7 +93,7 @@ select abs(a), abs(b), abs(c) from signed_integers;
 query RRR rowsort
 select acos(0), acos(0.5), acos(1);
 ----
-1.570796326795 1.047197551197 0
+1.570796327 1.047197551 0
 
 # acos scalar nulls
 query R rowsort
@@ -140,7 +140,7 @@ NaN 9.90349 NaN
 query RRR rowsort
 select asin(0), asin(0.5), asin(1);
 ----
-0 0.523598775598 1.570796326795
+0 0.5235987756 1.570796327
 
 # asin scalar nulls
 query R rowsort
@@ -187,7 +187,7 @@ select round(asinh(a), 5), round(asinh(b), 5), round(asinh(c), 5) from small_flo
 query RRR rowsort
 select atan(0), atan(cbrt(3)), atan(1);
 ----
-0 0.964539792856 0.785398163397
+0 0.9645397929 0.7853981634
 
 # atan scalar nulls
 query R rowsort
@@ -234,7 +234,7 @@ select round(atanh(a), 5), round(atanh(b), 5), round(atanh(c), 5) from small_flo
 query RRR rowsort
 select atan2(0, 1), atan2(1, 2), atan2(2, 2);
 ----
-0 0.4636476 0.7853982
+0 0.463648 0.785398
 
 # atan2 scalar nulls
 query R rowsort
@@ -338,7 +338,7 @@ select round(degrees(a), 5), round(degrees(e), 5), round(degrees(f), 5) from sig
 query RRR rowsort
 select cos(0), cos(pi() / 3), cos(pi() / 2);
 ----
-1 0.5 0
+1 0.5 0.00000000000000006123233996
 
 # cos scalar nulls
 query R rowsort
@@ -362,7 +362,7 @@ select round(cos(a), 5), round(cos(b), 5), round(cos(c), 5) from signed_integers
 query RRR rowsort
 select cosh(1), cosh(2), cosh(3);
 ----
-1.543080634815 3.762195691084 10.067661995778
+1.543080635 3.762195691 10.067662
 
 # cosh scalar nulls
 query R rowsort
@@ -385,7 +385,7 @@ select round(cosh(a), 5), round(cosh(b), 5), round(cosh(c), 5) from small_floats
 query RRR rowsort
 select exp(0), exp(1), exp(2);
 ----
-1 2.718281828459 7.389056098931
+1 2.718281828 7.389056099
 
 # exp scalar nulls
 query R rowsort
@@ -397,7 +397,7 @@ NULL
 query RRR rowsort
 select round(exp(a), 5), round(exp(e), 5), round(exp(f), 5) from signed_integers;
 ----
-0.04979 0.00248 162754.79142
+0.04979 0.00248 162754.7914
 0.36788 0.01832 22026.46579
 54.59815 NULL NULL
 7.38906 148.41316 0.00002
@@ -454,7 +454,7 @@ select floor(a), floor(b), floor(c) from signed_integers;
 query RRR rowsort
 select ln(1), ln(exp(1)), ln(3);
 ----
-0 1 1.098612288668
+0 1 1.098612289
 
 # ln scalar nulls
 query R rowsort
@@ -509,7 +509,7 @@ NULL NULL
 query RR rowsort
 select log(2, 2.0/3) a, log(10, 2.0/3) b;
 ----
--0.584962500721 -0.176091259056
+-0.5849625007 -0.1760912591
 
 # log scalar ops with zero edgecases
 # please see https://github.com/apache/datafusion/pull/5245#issuecomment-1426828382
@@ -523,7 +523,7 @@ query RRR rowsort
 select log(a, 64) a, log(b), log(10, b) from unsigned_integers;
 ----
 3 NULL NULL
-3.7855785 4 4
+3.78558 4 4
 6 3 3
 Infinity 2 2
 
@@ -546,8 +546,8 @@ select log(arrow_cast(10, 'Float64')) a ,log(arrow_cast(100, 'Float32')) b;
 query RR rowsort
 select log(arrow_cast(a, 'Float64')), log(arrow_cast(b, 'Float32')) from signed_integers;
 ----
-0.301029995664 NaN
-0.602059991328 NULL
+0.3010299957 NaN
+0.6020599913 NULL
 NaN 2
 NaN 4
 
@@ -563,8 +563,8 @@ select log(2,arrow_cast(a, 'Float64')), log(4,arrow_cast(b, 'Float32')) from sig
 ----
 1 NaN
 2 NULL
-NaN 3.321928
-NaN 6.643856
+NaN 3.32193
+NaN 6.64386
 
 
 ## log10
@@ -585,7 +585,7 @@ NULL
 query R rowsort
 select log10(2.0/3);
 ----
--0.176091259056
+-0.1760912591
 
 # log10 scalar ops with zero edgecases
 # please see https://github.com/apache/datafusion/pull/5245#issuecomment-1426828382
@@ -621,7 +621,7 @@ NULL
 query R rowsort
 select log2(2.0/3);
 ----
--0.584962500721
+-0.5849625007
 
 # log2 scalar ops with zero edgecases
 # please see https://github.com/apache/datafusion/pull/5245#issuecomment-1426828382
@@ -726,7 +726,7 @@ NULL NULL NULL NULL
 query RRR rowsort
 select pi(), pi() / 2, pi() / 3;
 ----
-3.14159265359 1.570796326795 1.047197551197
+3.141592654 1.570796327 1.047197551
 
 ## power
 
@@ -769,7 +769,7 @@ NaN NaN 2.32282
 query RRR rowsort
 select radians(0), radians(90), radians(180);
 ----
-0 1.570796326795 3.14159265359
+0 1.570796327 3.141592654
 
 # radians scalar nulls
 query R rowsort
@@ -848,7 +848,7 @@ select signum(a), signum(b), signum(c) from signed_integers;
 query RRR rowsort
 select sin(0), sin(pi() / 3), sin(pi() / 2);
 ----
-0 0.866025403784 1
+0 0.8660254038 1
 
 # sin scalar nulls
 query R rowsort
@@ -872,7 +872,7 @@ select round(sin(a), 5), round(sin(b), 5), round(sin(c), 5) from small_floats;
 query RRR rowsort
 select sinh(1), sinh(2), sinh(3);
 ----
-1.175201193644 3.626860407847 10.01787492741
+1.175201194 3.626860408 10.01787493
 
 # sinh scalar nulls
 query R rowsort
@@ -916,13 +916,13 @@ NaN 100 NaN
 query RR rowsort
 select sqrt(1.4), sqrt(2.0/3);
 ----
-1.18321595662 0.816496580928
+1.183215957 0.8164965809
 
 # sqrt scalar cast
 query R rowsort
 select sqrt(cast(10e8 as double));
 ----
-31622.776601683792
+31622.7766
 
 
 # sqrt scalar negative
@@ -937,7 +937,7 @@ NaN
 query RRR rowsort
 select tan(0), tan(pi() / 6), tan(pi() / 4);
 ----
-0 0.57735026919 1
+0 0.5773502692 1
 
 # tan scalar nulls
 query R rowsort
@@ -961,7 +961,7 @@ select round(tan(a), 5), round(tan(b), 5), round(tan(c), 5) from small_floats;
 query RRR rowsort
 select tanh(1), tanh(2), tanh(3);
 ----
-0.761594155956 0.964027580076 0.995054753687
+0.761594156 0.9640275801 0.9950547537
 
 # tanh scalar nulls
 query R rowsort
@@ -1360,27 +1360,27 @@ SELECT COUNT(*), COUNT(1) AS c, COUNT(c1) FROM aggregate_test_100
 query R
 SELECT sqrt(sqrt(c12)) FROM aggregate_test_100 LIMIT 1
 ----
-0.98186505614
+0.9818650561
 
 # csv query cbrt cbrt
 query R
 SELECT cbrt(cbrt(c12)) FROM aggregate_test_100 LIMIT 1
 ----
-0.991899036678
+0.9918990367
 
 # 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
+0.388703
+0.391444
 
 # 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
+0.311471254 1
+0.9294097332 1
 
 statement ok
 drop table aggregate_test_100
@@ -1595,7 +1595,7 @@ SELECT -2.e-1, 0.e0, .0002E+3, .02E+2;
 query RRRR
 SELECT -1.79e309, -2.22e-309, 2.22E-309, 1.79E+309;
 ----
--Infinity 0 0 Infinity
+-Infinity -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000222 Infinity
 
 # scientific notation (other edgecases)
 query IRRR
diff --git a/datafusion/sqllogictest/test_files/select.slt b/datafusion/sqllogictest/test_files/select.slt
index c687429ae6ec..5ce6f8ef57c7 100644
--- a/datafusion/sqllogictest/test_files/select.slt
+++ b/datafusion/sqllogictest/test_files/select.slt
@@ -861,11 +861,11 @@ true
 query R rowsort
 SELECT DISTINCT c1 + c2 AS a FROM aggregate_simple
 ----
-0.000010000001
-0.000020000001
-0.000030000002
-0.000040000003
-0.000050000004
+0.00001000000075
+0.00002000000149
+0.00003000000224
+0.00004000000299
+0.00005000000374
 
 # select distinct from
 query BBBBBBBB
diff --git a/datafusion/sqllogictest/test_files/topk.slt b/datafusion/sqllogictest/test_files/topk.slt
index 1dbce79e0f1a..574e876f0163 100644
--- a/datafusion/sqllogictest/test_files/topk.slt
+++ b/datafusion/sqllogictest/test_files/topk.slt
@@ -193,11 +193,11 @@ 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
+a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.745987 0.02182578039 ydkwycaISlYSlEq3TlkS2m15I2pcp8
+d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.896519 0.1640882545 y7C453hRWd4E7ImjNDWlpexB8nUqjh
+e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.669477 0.3914443657 xipQ93429ksjNcXPX5326VSg1xJZcW
+d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.419806 0.2153540234 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS
+a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.298778 0.2537253408 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs
 
 
 
@@ -208,11 +208,11 @@ 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
+a 4 -38 20744 762932956 308913475857409919 7 45465 1787652631 878137512938218976 0.745987 0.02182578039 ydkwycaISlYSlEq3TlkS2m15I2pcp8
+d 1 -98 13630 -1991133944 1184110014998006843 220 2986 225513085 9634106610243643486 0.896519 0.1640882545 y7C453hRWd4E7ImjNDWlpexB8nUqjh
+e 2 52 -12056 -1090239422 9011500141803970147 238 4168 2013662838 12565360638488684051 0.669477 0.3914443657 xipQ93429ksjNcXPX5326VSg1xJZcW
+d 1 -72 25590 1188089983 3090286296481837049 241 832 3542840110 5885937420286765261 0.419806 0.2153540234 wwXqSGKLyBQyPkonlzBNYUJTCo4LRS
+a 1 -5 12636 794623392 2909750622865366631 15 24022 2669374863 4776679784701509574 0.298778 0.2537253408 waIGbOGl1PM6gnzZ4uuZt4E2yDWRHs
 
 
 ## make an example for dictionary encoding
diff --git a/datafusion/sqllogictest/test_files/tpch/answers/q14.slt.part b/datafusion/sqllogictest/test_files/tpch/answers/q14.slt.part
index e3a72548bcfa..3f65b5f453d9 100644
--- a/datafusion/sqllogictest/test_files/tpch/answers/q14.slt.part
+++ b/datafusion/sqllogictest/test_files/tpch/answers/q14.slt.part
@@ -31,4 +31,4 @@ where
   and l_shipdate >= date '1995-09-01'
   and l_shipdate < date '1995-10-01';
 ----
-16.283855689006
+16.28385569
diff --git a/datafusion/sqllogictest/test_files/tpch/answers/q17.slt.part b/datafusion/sqllogictest/test_files/tpch/answers/q17.slt.part
index cdf7f1de8374..96a06a7121dc 100644
--- a/datafusion/sqllogictest/test_files/tpch/answers/q17.slt.part
+++ b/datafusion/sqllogictest/test_files/tpch/answers/q17.slt.part
@@ -35,4 +35,4 @@ where
             l_partkey = p_partkey
 );
 ----
-23512.752857142856
+23512.75286
diff --git a/datafusion/sqllogictest/test_files/window.slt b/datafusion/sqllogictest/test_files/window.slt
index 188e2ae0915f..f07f45182d4a 100644
--- a/datafusion/sqllogictest/test_files/window.slt
+++ b/datafusion/sqllogictest/test_files/window.slt
@@ -111,8 +111,8 @@ 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
+141047417 575165281 191721760.3 3 623103518 -108973366 61035129 623103518 -108973366
+141680161 -1352462829 -338115707.3 4 623103518 -1927628110 61035129 -1927628110 -108973366
 145294611 -3251637940 -650327588 5 623103518 -1927628110 61035129 -1899175111 -108973366
 
 # csv_query_window_with_partition_by_order_by
@@ -449,11 +449,11 @@ FROM aggregate_test_100
 ORDER BY c9
 LIMIT 5
 ----
--48302 -16100.666666666666 3
-11243 3747.666666666666 3
--51311 -17103.666666666668 3
+-48302 -16100.66667 3
+11243 3747.666667 3
+-51311 -17103.66667 3
 -2391 -797 3
-46756 15585.333333333334 3
+46756 15585.33333 3
 
 
 # window_frame_rows_preceding_stddev_variance
@@ -467,11 +467,11 @@ 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
+46721.33333 31147.55556 216.1511817 176.4867008
+2639429.333 1759619.556 1624.632061 1326.506523
+746202.3333 497468.2222 863.8300373 705.314272
+768423 512282 876.597399 715.7387792
+66526.33333 44350.88889 257.9269923 210.5965073
 
 # window_frame_rows_preceding_with_partition_unique_order_by
 query IRI
@@ -487,7 +487,7 @@ LIMIT 5
 17547 8773.5 2
 -1301 -650.5 2
 26638 13319 3
-26861 8953.666666666666 3
+26861 8953.666667 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.
@@ -886,11 +886,11 @@ SELECT
  ORDER BY C9
  LIMIT 5
 ----
-2.547670180363
-10.629941254821
-2.547670180363
-20.349518503437
-21.408674363508
+2.54767018
+10.62994125
+2.54767018
+20.3495185
+21.40867436
 
 #fn window_frame_ranges_timestamp
 
@@ -1161,10 +1161,10 @@ SELECT
   ORDER BY c9
   LIMIT 5
 ----
-28774375 80 80 5 5 0.79797979798 0.79797979798
-63044568 62 62 4 4 0.616161616162 0.616161616162
+28774375 80 80 5 5 0.797979798 0.797979798
+63044568 62 62 4 4 0.6161616162 0.6161616162
 141047417 1 1 1 1 0 0
-141680161 41 41 3 3 0.40404040404 0.40404040404
+141680161 41 41 3 3 0.404040404 0.404040404
 145294611 1 1 1 1 0 0
 
 #fn test_lag_lead
@@ -2219,11 +2219,11 @@ SELECT SUM(c12) OVER(ORDER BY c1, c2 GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING)
   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
+4.561269874 18.03618343
+6.808931569 10.23844867
+2.994840293 NULL
+9.674390599 NULL
+7.72806622 NULL
 
 # test_c9_rn_ordering_alias
 # These tests check whether DataFusion is aware of the ordering generated by the ROW_NUMBER() window function.
@@ -2760,9 +2760,9 @@ SELECT
   ORDER BY inc_col ASC
   LIMIT 5
 ----
-16 6 1 1 10 5 3 2 5.333333333333 3
-16 6 1 1 10 5 3 2 5.333333333333 3
-51 16 1 1 20 10 5 3 10.2 5.333333333333
+16 6 1 1 10 5 3 2 5.333333333 3
+16 6 1 1 10 5 3 2 5.333333333 3
+51 16 1 1 20 10 5 3 10.2 5.333333333
 72 72 1 1 21 21 6 6 12 12
 72 72 1 1 21 21 6 6 12 12
 
@@ -3303,11 +3303,11 @@ 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
+-117 0.8506721053 0.8506721053
+-117 0.9706712283 0.9706712283
+-111 0.152498293 0.152498293
+-107 0.369363046 0.369363046
+-106 0.5653528422 0.5653528422
 
 query TT
 EXPLAIN SELECT
@@ -3350,11 +3350,11 @@ 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
+-117 0.8506721053 0.01479305308
+-117 0.9706712283 0.01479305308
+-111 0.152498293 0.01479305308
+-107 0.369363046 0.01479305308
+-106 0.5653528422 0.01479305308
 
 query TT
 EXPLAIN SELECT
@@ -5054,7 +5054,7 @@ select b, row_number() over (order by a) from (select TRUE as a, 1 as b);
 1 1
 
 # test window functions on boolean columns
-query T
+statement count 0
 create table t1 (id int, bool_col boolean) as values 
     (1, true),
     (2, false),
@@ -5098,8 +5098,8 @@ select percent_rank() over (order by bool_col) from t1;
 ----
 0
 0
-0.666666666667
-0.666666666667
+0.6666666667
+0.6666666667
 
 query I
 select ntile(2) over (order by bool_col) from t1;
@@ -5120,9 +5120,9 @@ select
 from t1
 order by id;
 ----
-3 3 2 1 0.666666666667 2
+3 3 2 1 0.6666666667 2
 1 1 1 0.5 0 1
-4 3 2 1 0.666666666667 2
+4 3 2 1 0.6666666667 2
 2 1 1 0.5 0 1
 
 statement ok
