You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/07/02 21:24:46 UTC
(datafusion) 01/01: fix: Handle decimal columns consistently in SLT tests (#23161)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23161-e1c901274782fbf85803d8645d38542a79e0577f
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit ad7d6ea8ef173e3a9e38dd6340034d249fb8e092
Author: Adam Gutglick <ad...@gmail.com>
AuthorDate: Thu Jul 2 22:24:23 2026 +0100
fix: Handle decimal columns consistently in SLT tests (#23161)
## Which issue does this PR close?
- Closes #23160.
## Rationale for this change
As described in the issue, different width decimals are currently
handled differently, going through inconsistent display path and not
presenting the full precision.
## What changes are included in this PR?
1. Unifies all handling and formatting for the four decimal variants,
which are now all supported. Also includes full display of decimal
values up to the specified precision, which should be deterministic.
2. I've also reran the all tests with `--complete`, which makes a few
random changes around empty whitespaces which I think is good to run
periodically (I keep doing that locally in unrelated changes and having
to `git restore` a bunch of files). Would it make sense to maybe add
this check to CI and verify it leaves the worktree clean?
## Are these changes tested?
Ran all tests locally
## Are there any user-facing changes?
Users of `datafusion-sqllogictest` will get different results if they
depend on the existing behavior.
---------
Signed-off-by: Adam Gutglick <ad...@gmail.com>
---
datafusion/sqllogictest/src/engines/conversion.rs | 38 ++++++++++++--------
.../src/engines/datafusion_engine/normalize.rs | 24 +++++++++----
datafusion/sqllogictest/test_files/aggregate.slt | 2 +-
.../test_files/aggregate_repartition.slt | 2 +-
.../test_files/aggregate_skip_partial.slt | 6 ++--
.../sqllogictest/test_files/array/cleanup.slt.part | 1 -
.../test_files/array/init_data.slt.part | 1 -
.../test_files/array_agg_sliding_window.slt | 2 +-
datafusion/sqllogictest/test_files/group_by.slt | 2 +-
datafusion/sqllogictest/test_files/options.slt | 10 +++---
datafusion/sqllogictest/test_files/qualify.slt | 42 +++++++++++-----------
.../sqllogictest/test_files/spark/array/slice.slt | 2 +-
.../test_files/spark/map/str_to_map.slt | 2 +-
.../sqllogictest/test_files/spark/math/pow.slt | 2 +-
.../sqllogictest/test_files/spark/math/round.slt | 32 ++++++++---------
datafusion/sqllogictest/test_files/subquery.slt | 8 ++---
datafusion/sqllogictest/test_files/tpch/tpch.slt | 2 +-
datafusion/sqllogictest/test_files/union.slt | 32 ++++++++---------
datafusion/sqllogictest/test_files/window.slt | 2 +-
19 files changed, 115 insertions(+), 97 deletions(-)
diff --git a/datafusion/sqllogictest/src/engines/conversion.rs b/datafusion/sqllogictest/src/engines/conversion.rs
index 3e519042f4..4447ea9f03 100644
--- a/datafusion/sqllogictest/src/engines/conversion.rs
+++ b/datafusion/sqllogictest/src/engines/conversion.rs
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-use arrow::datatypes::{Decimal128Type, Decimal256Type, DecimalType, i256};
+use arrow::datatypes::DecimalType;
use bigdecimal::BigDecimal;
use half::f16;
use std::str::FromStr;
@@ -96,21 +96,15 @@ pub(crate) fn spark_f64_to_str(value: f64) -> String {
}
}
-pub(crate) fn decimal_128_to_str(value: i128, scale: i8) -> String {
+pub(crate) fn arrow_decimal_to_str<T: DecimalType>(
+ value: T::Native,
+ scale: i8,
+) -> String {
let precision = u8::MAX; // does not matter
+ let value = T::format_decimal(value, precision, scale);
big_decimal_to_str(
- BigDecimal::from_str(&Decimal128Type::format_decimal(value, precision, scale))
- .unwrap(),
- None,
- )
-}
-
-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(),
- None,
+ BigDecimal::from_str(&value).unwrap(),
+ Some(i64::from(scale)),
)
}
@@ -132,7 +126,10 @@ pub(crate) fn big_decimal_to_str(value: BigDecimal, round_digits: Option<i64>) -
#[cfg(test)]
mod tests {
- use super::big_decimal_to_str;
+ use super::{arrow_decimal_to_str, big_decimal_to_str};
+ use arrow::datatypes::{
+ Decimal32Type, Decimal64Type, Decimal128Type, Decimal256Type, i256,
+ };
use bigdecimal::{BigDecimal, num_bigint::BigInt};
macro_rules! assert_decimal_str_eq {
@@ -196,4 +193,15 @@ mod tests {
assert_decimal_str_eq!(10_i128.pow(13) + 11, 13, Some(13), "1.0000000000011");
}
+
+ #[test]
+ fn test_arrow_decimal_to_str() {
+ assert_eq!(arrow_decimal_to_str::<Decimal32Type>(12345, 2), "123.45");
+ assert_eq!(arrow_decimal_to_str::<Decimal64Type>(12345, 2), "123.45");
+ assert_eq!(arrow_decimal_to_str::<Decimal128Type>(12345, 2), "123.45");
+ assert_eq!(
+ arrow_decimal_to_str::<Decimal256Type>(i256::from(12345), 2),
+ "123.45"
+ );
+ }
}
diff --git a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
index 2c549422d6..fa566a6a3d 100644
--- a/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
+++ b/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs
@@ -19,7 +19,9 @@ use super::super::conversion::*;
use super::error::{DFSqlLogicTestError, Result};
use crate::engines::output::DFColumnType;
use arrow::array::{Array, AsArray};
-use arrow::datatypes::{Fields, Schema};
+use arrow::datatypes::{
+ Decimal32Type, Decimal64Type, Decimal128Type, Decimal256Type, Fields, Schema,
+};
use arrow::util::display::ArrayFormatter;
use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch};
use datafusion::common::internal_datafusion_err;
@@ -209,13 +211,21 @@ pub fn cell_to_string(col: &ArrayRef, row: usize, is_spark_path: bool) -> Result
Ok(f64_to_str(result))
}
}
+ DataType::Decimal32(_, scale) => {
+ let value = get_row_value!(array::Decimal32Array, col, row);
+ Ok(arrow_decimal_to_str::<Decimal32Type>(value, *scale))
+ }
+ DataType::Decimal64(_, scale) => {
+ let value = get_row_value!(array::Decimal64Array, col, row);
+ Ok(arrow_decimal_to_str::<Decimal64Type>(value, *scale))
+ }
DataType::Decimal128(_, scale) => {
let value = get_row_value!(array::Decimal128Array, col, row);
- Ok(decimal_128_to_str(value, *scale))
+ Ok(arrow_decimal_to_str::<Decimal128Type>(value, *scale))
}
DataType::Decimal256(_, scale) => {
let value = get_row_value!(array::Decimal256Array, col, row);
- Ok(decimal_256_to_str(value, *scale))
+ Ok(arrow_decimal_to_str::<Decimal256Type>(value, *scale))
}
DataType::LargeUtf8 => Ok(varchar_to_str(get_row_value!(
array::LargeStringArray,
@@ -268,9 +278,11 @@ pub fn convert_schema_to_types(columns: &Fields) -> Vec<DFColumnType> {
| DataType::UInt16
| DataType::UInt32
| DataType::UInt64 => DFColumnType::Integer,
- DataType::Float16
- | DataType::Float32
- | DataType::Float64
+ DataType::Float16 | DataType::Float32 | DataType::Float64 => {
+ DFColumnType::Float
+ }
+ DataType::Decimal32(_, _)
+ | DataType::Decimal64(_, _)
| DataType::Decimal128(_, _)
| DataType::Decimal256(_, _) => DFColumnType::Float,
DataType::Utf8 | DataType::LargeUtf8 | DataType::Utf8View => {
diff --git a/datafusion/sqllogictest/test_files/aggregate.slt b/datafusion/sqllogictest/test_files/aggregate.slt
index dbf5063a30..dcfa272687 100644
--- a/datafusion/sqllogictest/test_files/aggregate.slt
+++ b/datafusion/sqllogictest/test_files/aggregate.slt
@@ -9179,7 +9179,7 @@ ORDER BY g;
# Config reset
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
diff --git a/datafusion/sqllogictest/test_files/aggregate_repartition.slt b/datafusion/sqllogictest/test_files/aggregate_repartition.slt
index 1f1e726811..2302e161bf 100644
--- a/datafusion/sqllogictest/test_files/aggregate_repartition.slt
+++ b/datafusion/sqllogictest/test_files/aggregate_repartition.slt
@@ -131,7 +131,7 @@ physical_plan
# Config reset
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
SET datafusion.execution.target_partitions = 4;
diff --git a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
index a10417f232..195441a119 100644
--- a/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
+++ b/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
@@ -220,7 +220,7 @@ e true false NULL
statement ok
reset datafusion.execution.batch_size;
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
@@ -712,7 +712,7 @@ ORDER BY i;
statement ok
reset datafusion.execution.batch_size;
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
@@ -772,7 +772,7 @@ true false false false false true false NULL
statement ok
reset datafusion.execution.batch_size;
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
diff --git a/datafusion/sqllogictest/test_files/array/cleanup.slt.part b/datafusion/sqllogictest/test_files/array/cleanup.slt.part
index a11a4770ec..eff5d17acf 100644
--- a/datafusion/sqllogictest/test_files/array/cleanup.slt.part
+++ b/datafusion/sqllogictest/test_files/array/cleanup.slt.part
@@ -167,4 +167,3 @@ drop table large_arrays_values_without_nulls;
statement ok
drop table fixed_size_arrays_values_without_nulls;
-
diff --git a/datafusion/sqllogictest/test_files/array/init_data.slt.part b/datafusion/sqllogictest/test_files/array/init_data.slt.part
index f5cc58fb2b..bb8d76809f 100644
--- a/datafusion/sqllogictest/test_files/array/init_data.slt.part
+++ b/datafusion/sqllogictest/test_files/array/init_data.slt.part
@@ -689,4 +689,3 @@ AS
FROM arrays_distance_table
;
-
diff --git a/datafusion/sqllogictest/test_files/array_agg_sliding_window.slt b/datafusion/sqllogictest/test_files/array_agg_sliding_window.slt
index 6f0712e2a6..c828794b1d 100644
--- a/datafusion/sqllogictest/test_files/array_agg_sliding_window.slt
+++ b/datafusion/sqllogictest/test_files/array_agg_sliding_window.slt
@@ -430,4 +430,4 @@ statement ok
DROP TABLE t_dist_parts;
statement ok
-DROP TABLE t_dist_int;
\ No newline at end of file
+DROP TABLE t_dist_int;
diff --git a/datafusion/sqllogictest/test_files/group_by.slt b/datafusion/sqllogictest/test_files/group_by.slt
index 8c055c25ca..d435898f7b 100644
--- a/datafusion/sqllogictest/test_files/group_by.slt
+++ b/datafusion/sqllogictest/test_files/group_by.slt
@@ -5634,7 +5634,7 @@ physical_plan
statement ok
reset datafusion.execution.batch_size;
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
diff --git a/datafusion/sqllogictest/test_files/options.slt b/datafusion/sqllogictest/test_files/options.slt
index 0d1583dbc0..00d7664779 100644
--- a/datafusion/sqllogictest/test_files/options.slt
+++ b/datafusion/sqllogictest/test_files/options.slt
@@ -209,20 +209,20 @@ query RT
select 123456789.0123456789012345678901234567890,
arrow_typeof(123456789.0123456789012345678901234567890)
----
-123456789.012345678901 Decimal256(40, 31)
+123456789.012345678901234567890123456789 Decimal256(40, 31)
query RT
select -123456789.0123456789012345678901234567890,
arrow_typeof(-123456789.0123456789012345678901234567890)
----
--123456789.012345678901 Decimal256(40, 31)
+-123456789.012345678901234567890123456789 Decimal256(40, 31)
# max precision and scale of Decimal256
query RTRT
select -1e-76, arrow_typeof(-1e-76),
-1.234567e-70, arrow_typeof(-1.234567e-70)
----
-0 Decimal256(76, 76) 0 Decimal256(76, 76)
+-0.0000000000000000000000000000000000000000000000000000000000000000000000000001 Decimal256(76, 76) -0.0000000000000000000000000000000000000000000000000000000000000000000001234567 Decimal256(76, 76)
# Decimal256::MAX for nonnegative scale
query RT
@@ -243,13 +243,13 @@ query RTRT
select 1e-38, arrow_typeof(1e-38),
1e-39, arrow_typeof(1e-39);
----
-0 Decimal128(38, 38) 0 Decimal256(39, 39)
+0.00000000000000000000000000000000000001 Decimal128(38, 38) 0.000000000000000000000000000000000000001 Decimal256(39, 39)
query RTRT
select -1e-38, arrow_typeof(-1e-38),
-1e-39, arrow_typeof(-1e-39);
----
-0 Decimal128(38, 38) 0 Decimal256(39, 39)
+-0.00000000000000000000000000000000000001 Decimal128(38, 38) -0.000000000000000000000000000000000000001 Decimal256(39, 39)
# unsupported precision
query error Decimal precision 77 exceeds the maximum supported precision: 76
diff --git a/datafusion/sqllogictest/test_files/qualify.slt b/datafusion/sqllogictest/test_files/qualify.slt
index 68aae16d90..b70f078327 100644
--- a/datafusion/sqllogictest/test_files/qualify.slt
+++ b/datafusion/sqllogictest/test_files/qualify.slt
@@ -39,8 +39,8 @@ CREATE TABLE users (
# Basic QUALIFY with ROW_NUMBER
query ITI
-SELECT id, name, ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rn
-FROM users
+SELECT id, name, ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rn
+FROM users
QUALIFY rn = 1
ORDER BY dept, id;
----
@@ -49,8 +49,8 @@ ORDER BY dept, id;
# QUALIFY with RANK
query ITI
-SELECT id, name, RANK() OVER (ORDER BY salary DESC) as rank
-FROM users
+SELECT id, name, RANK() OVER (ORDER BY salary DESC) as rank
+FROM users
QUALIFY rank <= 3
ORDER BY rank, id;
----
@@ -60,8 +60,8 @@ ORDER BY rank, id;
# QUALIFY with DENSE_RANK
query ITI
-SELECT id, name, DENSE_RANK() OVER (PARTITION BY dept ORDER BY age) as dense_rank
-FROM users
+SELECT id, name, DENSE_RANK() OVER (PARTITION BY dept ORDER BY age) as dense_rank
+FROM users
QUALIFY dense_rank <= 2
ORDER BY dept, dense_rank, id;
----
@@ -78,7 +78,7 @@ ORDER BY dept, dense_rank, id;
query ITII
SELECT id, name, ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rn,
RANK() OVER (ORDER BY age) as age_rank
-FROM users
+FROM users
QUALIFY rn <= 2 AND age_rank <= 5
ORDER BY dept, rn, id;
----
@@ -88,7 +88,7 @@ ORDER BY dept, rn, id;
# QUALIFY with LAG function
query ITRR
SELECT id, name, salary, LAG(salary) OVER (PARTITION BY dept ORDER BY id) as prev_salary
-FROM users
+FROM users
QUALIFY prev_salary IS NOT NULL AND salary > prev_salary
ORDER BY dept, id;
----
@@ -99,7 +99,7 @@ ORDER BY dept, id;
# QUALIFY with LEAD function
query ITRR
SELECT id, name, salary, LEAD(salary) OVER (PARTITION BY dept ORDER BY id) as next_salary
-FROM users
+FROM users
QUALIFY next_salary IS NOT NULL AND salary < next_salary
ORDER BY dept, id;
----
@@ -110,7 +110,7 @@ ORDER BY dept, id;
# QUALIFY with NTILE
query ITI
SELECT id, name, NTILE(3) OVER (PARTITION BY dept ORDER BY salary DESC) as tile
-FROM users
+FROM users
QUALIFY tile = 1
ORDER BY dept, id;
----
@@ -121,7 +121,7 @@ ORDER BY dept, id;
# QUALIFY with PERCENT_RANK
query ITR
SELECT id, name, PERCENT_RANK() OVER (PARTITION BY dept ORDER BY salary) as pct_rank
-FROM users
+FROM users
QUALIFY pct_rank >= 0.5
ORDER BY dept, pct_rank, id;
----
@@ -134,7 +134,7 @@ ORDER BY dept, pct_rank, id;
# QUALIFY with CUME_DIST
query ITR
SELECT id, name, CUME_DIST() OVER (PARTITION BY dept ORDER BY age) as cume_dist
-FROM users
+FROM users
QUALIFY cume_dist >= 0.75
ORDER BY dept, cume_dist, id;
----
@@ -145,11 +145,11 @@ ORDER BY dept, cume_dist, id;
# QUALIFY with multiple window functions
query ITIII
-SELECT id, name,
+SELECT id, name,
ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rn,
RANK() OVER (ORDER BY age) as age_rank,
DENSE_RANK() OVER (PARTITION BY dept ORDER BY age) as dept_age_rank
-FROM users
+FROM users
QUALIFY rn <= 2 AND age_rank <= 4 AND dept_age_rank <= 2
ORDER BY dept, rn, id;
----
@@ -158,9 +158,9 @@ ORDER BY dept, rn, id;
# QUALIFY with arithmetic expressions
query ITRI
-SELECT id, name, salary,
+SELECT id, name, salary,
ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC) as rn
-FROM users
+FROM users
QUALIFY rn = 1 AND salary > 60000
ORDER BY dept, id;
----
@@ -169,9 +169,9 @@ ORDER BY dept, id;
# QUALIFY with string functions
query ITI
-SELECT id, name,
+SELECT id, name,
ROW_NUMBER() OVER (PARTITION BY dept ORDER BY name) as rn
-FROM users
+FROM users
QUALIFY rn = 1
ORDER BY dept, id;
----
@@ -181,7 +181,7 @@ ORDER BY dept, id;
# window function with aggregate function
query ITI
SELECT id, name, COUNT(*) OVER (PARTITION BY dept) as cnt
-FROM users
+FROM users
QUALIFY cnt > 4
ORDER BY dept, id;
----
@@ -198,7 +198,7 @@ FROM users
WHERE salary > 5000
GROUP BY dept, salary
HAVING SUM(salary) > 20000
-QUALIFY r > 60000
+QUALIFY r > 60000
----
Marketing 70000
Marketing 70000
@@ -360,4 +360,4 @@ physical_plan
# Clean up
statement ok
-DROP TABLE users;
+DROP TABLE users;
diff --git a/datafusion/sqllogictest/test_files/spark/array/slice.slt b/datafusion/sqllogictest/test_files/spark/array/slice.slt
index 7be2342841..aaf4aa4909 100644
--- a/datafusion/sqllogictest/test_files/spark/array/slice.slt
+++ b/datafusion/sqllogictest/test_files/spark/array/slice.slt
@@ -151,4 +151,4 @@ SELECT slice(make_array(1, 2, 3, 4), -5, 2)
query ?
SELECT slice(make_array(1), 3, 4)
----
-[]
\ No newline at end of file
+[]
diff --git a/datafusion/sqllogictest/test_files/spark/map/str_to_map.slt b/datafusion/sqllogictest/test_files/spark/map/str_to_map.slt
index 68d856d854..f422b50dfa 100644
--- a/datafusion/sqllogictest/test_files/spark/map/str_to_map.slt
+++ b/datafusion/sqllogictest/test_files/spark/map/str_to_map.slt
@@ -160,4 +160,4 @@ set datafusion.spark.map_key_dedup_policy = 'EXCEPTION';
# Invalid policy values are rejected at SET time with a clear message.
statement error DataFusion error: Invalid or Unsupported Configuration: Invalid MapKeyDedupPolicy: BOGUS\. Expected one of: EXCEPTION, LAST_WIN
-set datafusion.spark.map_key_dedup_policy = 'BOGUS';
\ No newline at end of file
+set datafusion.spark.map_key_dedup_policy = 'BOGUS';
diff --git a/datafusion/sqllogictest/test_files/spark/math/pow.slt b/datafusion/sqllogictest/test_files/spark/math/pow.slt
index 5d287a81d9..17c3cfa18b 100644
--- a/datafusion/sqllogictest/test_files/spark/math/pow.slt
+++ b/datafusion/sqllogictest/test_files/spark/math/pow.slt
@@ -172,4 +172,4 @@ Infinity
0
statement ok
-DROP TABLE t2;
\ No newline at end of file
+DROP TABLE t2;
diff --git a/datafusion/sqllogictest/test_files/spark/math/round.slt b/datafusion/sqllogictest/test_files/spark/math/round.slt
index 49956846ac..7fee15079d 100644
--- a/datafusion/sqllogictest/test_files/spark/math/round.slt
+++ b/datafusion/sqllogictest/test_files/spark/math/round.slt
@@ -305,52 +305,52 @@ SELECT round(arrow_cast(42, 'UInt32'), 2::int);
# --- Decimal32 ---
# round(decimal32, 0) — round to integer
-query ?
+query R
SELECT round(arrow_cast(2.5, 'Decimal32(9, 1)'), 0::int);
----
-3.0
+3
-query ?
+query R
SELECT round(arrow_cast(-2.5, 'Decimal32(9, 1)'), 0::int);
----
--3.0
+-3
# round(decimal32, 2)
-query ?
+query R
SELECT round(arrow_cast(2.345, 'Decimal32(9, 3)'), 2::int);
----
-2.350
+2.35
# round(decimal32) default scale = 0
-query ?
+query R
SELECT round(arrow_cast(3.5, 'Decimal32(9, 1)'));
----
-4.0
+4
# --- Decimal64 ---
# round(decimal64, 0) — round to integer
-query ?
+query R
SELECT round(arrow_cast(2.5, 'Decimal64(18, 1)'), 0::int);
----
-3.0
+3
-query ?
+query R
SELECT round(arrow_cast(-2.5, 'Decimal64(18, 1)'), 0::int);
----
--3.0
+-3
# round(decimal64, 2)
-query ?
+query R
SELECT round(arrow_cast(2.345, 'Decimal64(18, 3)'), 2::int);
----
-2.350
+2.35
# round(decimal64) default scale = 0
-query ?
+query R
SELECT round(arrow_cast(3.5, 'Decimal64(18, 1)'));
----
-4.0
+4
# --- Decimal128 ---
diff --git a/datafusion/sqllogictest/test_files/subquery.slt b/datafusion/sqllogictest/test_files/subquery.slt
index 908ee6bb3b..6b18150760 100644
--- a/datafusion/sqllogictest/test_files/subquery.slt
+++ b/datafusion/sqllogictest/test_files/subquery.slt
@@ -387,7 +387,7 @@ query TT
explain SELECT t1_id, t1_name, t1_int FROM t1 WHERE EXISTS(SELECT t1_int FROM t1 WHERE t1.t1_id > t1.t1_int)
----
logical_plan
-01)LeftSemi Join:
+01)LeftSemi Join:
02)--TableScan: t1 projection=[t1_id, t1_name, t1_int]
03)--SubqueryAlias: __correlated_sq_1
04)----Projection:
@@ -606,7 +606,7 @@ query TT
explain SELECT t1_id, t1_name FROM t1 WHERE EXISTS (SELECT NULL)
----
logical_plan
-01)LeftSemi Join:
+01)LeftSemi Join:
02)--TableScan: t1 projection=[t1_id, t1_name]
03)--SubqueryAlias: __correlated_sq_1
04)----EmptyRelation: rows=1
@@ -1623,7 +1623,7 @@ query TT
explain SELECT a FROM t1 WHERE EXISTS (SELECT count(*) FROM t2)
----
logical_plan
-01)LeftSemi Join:
+01)LeftSemi Join:
02)--TableScan: t1 projection=[a]
03)--SubqueryAlias: __correlated_sq_1
04)----EmptyRelation: rows=1
@@ -1640,7 +1640,7 @@ statement count 0
create table person(id int, last_name int, state int);
query TT
-explain SELECT id FROM person p WHERE EXISTS
+explain SELECT id FROM person p WHERE EXISTS
(SELECT * FROM person WHERE last_name = p.last_name AND state = p.state)
----
logical_plan
diff --git a/datafusion/sqllogictest/test_files/tpch/tpch.slt b/datafusion/sqllogictest/test_files/tpch/tpch.slt
index b893ff61cd..4a1cb4f9e0 100644
--- a/datafusion/sqllogictest/test_files/tpch/tpch.slt
+++ b/datafusion/sqllogictest/test_files/tpch/tpch.slt
@@ -40,4 +40,4 @@ include ./drop_tables.slt.part
# Config reset
statement ok
-reset datafusion.optimizer.prefer_hash_join;
\ No newline at end of file
+reset datafusion.optimizer.prefer_hash_join;
diff --git a/datafusion/sqllogictest/test_files/union.slt b/datafusion/sqllogictest/test_files/union.slt
index a48ede6049..41021299fb 100644
--- a/datafusion/sqllogictest/test_files/union.slt
+++ b/datafusion/sqllogictest/test_files/union.slt
@@ -21,11 +21,11 @@
statement ok
CREATE TABLE t1(
- id INT,
+ id INT,
name TEXT
) as VALUES
- (1, 'Alex'),
- (2, 'Bob'),
+ (1, 'Alex'),
+ (2, 'Bob'),
(3, 'Alice')
;
@@ -34,20 +34,20 @@ CREATE TABLE t2(
id TINYINT,
name TEXT
) as VALUES
- (1, 'Alex'),
- (2, 'Bob'),
+ (1, 'Alex'),
+ (2, 'Bob'),
(3, 'John')
;
# union with EXCEPT(JOIN)
query T rowsort
-(
+(
SELECT name FROM t1
EXCEPT
SELECT name FROM t2
-)
+)
UNION ALL
-(
+(
SELECT name FROM t2
EXCEPT
SELECT name FROM t1
@@ -58,13 +58,13 @@ John
# union with type coercion
query IT rowsort
-(
+(
SELECT * FROM t1
EXCEPT
SELECT * FROM t2
-)
+)
UNION ALL
-(
+(
SELECT * FROM t2
EXCEPT
SELECT * FROM t1
@@ -643,11 +643,11 @@ OPTIONS ('format.has_header' 'true');
query TT
explain
SELECT c1 FROM(
-(
+(
SELECT c1 FROM t1
-)
+)
UNION ALL
-(
+(
SELECT c1a FROM t2
))
ORDER BY c1
@@ -822,8 +822,8 @@ DROP TABLE t4;
# Test issue: https://github.com/apache/datafusion/issues/11742
query R rowsort
-WITH
- tt(v1) AS (VALUES (1::INT),(NULL::INT))
+WITH
+ tt(v1) AS (VALUES (1::INT),(NULL::INT))
SELECT NVL(v1, 0.5) FROM tt
UNION ALL
SELECT NULL WHERE FALSE;
diff --git a/datafusion/sqllogictest/test_files/window.slt b/datafusion/sqllogictest/test_files/window.slt
index 22aaf09dff..b6cc822bbc 100644
--- a/datafusion/sqllogictest/test_files/window.slt
+++ b/datafusion/sqllogictest/test_files/window.slt
@@ -6816,7 +6816,7 @@ ORDER BY i;
statement ok
reset datafusion.execution.batch_size;
-# The SLT runner sets `target_partitions` to 4 instead of using the default, so
+# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# reset it explicitly.
statement ok
set datafusion.execution.target_partitions = 4;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org