Skip to content

Commit 42f7dd5

Browse files
matthewwillianMatt
andauthored
Remove tests from sql_integration that were ported to sqllogictest (apache#4836)
* delete tests duplicated between sqllogictests and aggregates / arrow_typeof * recomment failing test * remove typo * add back in test that's broken in sqllogictest * remove arrow module Co-authored-by: Matt <[email protected]>
1 parent c4f4dff commit 42f7dd5

File tree

4 files changed

+13
-227
lines changed

4 files changed

+13
-227
lines changed

datafusion/core/tests/sql/aggregates.rs

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@ use datafusion::scalar::ScalarValue;
2020
use datafusion::test_util::scan_empty;
2121
use datafusion_common::cast::as_float64_array;
2222

23-
#[tokio::test]
24-
async fn csv_query_avg_multi_batch() -> Result<()> {
25-
let ctx = SessionContext::new();
26-
register_aggregate_csv(&ctx).await?;
27-
let sql = "SELECT avg(c12) FROM aggregate_test_100";
28-
let dataframe = ctx.sql(sql).await.unwrap();
29-
let results = dataframe.collect().await.unwrap();
30-
let batch = &results[0];
31-
let column = batch.column(0);
32-
let array = as_float64_array(column)?;
33-
let actual = array.value(0);
34-
let expected = 0.5089725;
35-
// Due to float number's accuracy, different batch size will lead to different
36-
// answers.
37-
assert!((expected - actual).abs() < 0.01);
38-
Ok(())
39-
}
40-
4123
#[tokio::test]
4224
#[ignore] // https://github.com/apache/arrow-datafusion/issues/3353
4325
async fn csv_query_approx_count() -> Result<()> {
@@ -120,60 +102,6 @@ async fn csv_query_approx_percentile_cont_with_histogram_bins() -> Result<()> {
120102
Ok(())
121103
}
122104

123-
#[tokio::test]
124-
async fn csv_query_array_agg() -> Result<()> {
125-
let ctx = SessionContext::new();
126-
register_aggregate_csv(&ctx).await?;
127-
let sql =
128-
"SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 2) test";
129-
let actual = execute_to_batches(&ctx, sql).await;
130-
let expected = vec![
131-
"+------------------------------------------------------------------+",
132-
"| ARRAYAGG(test.c13) |",
133-
"+------------------------------------------------------------------+",
134-
"| [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB] |",
135-
"+------------------------------------------------------------------+",
136-
];
137-
assert_batches_eq!(expected, &actual);
138-
Ok(())
139-
}
140-
141-
#[tokio::test]
142-
async fn csv_query_array_agg_empty() -> Result<()> {
143-
let ctx = SessionContext::new();
144-
register_aggregate_csv(&ctx).await?;
145-
let sql =
146-
"SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 LIMIT 0) test";
147-
let actual = execute_to_batches(&ctx, sql).await;
148-
let expected = vec![
149-
"+--------------------+",
150-
"| ARRAYAGG(test.c13) |",
151-
"+--------------------+",
152-
"| [] |",
153-
"+--------------------+",
154-
];
155-
assert_batches_eq!(expected, &actual);
156-
Ok(())
157-
}
158-
159-
#[tokio::test]
160-
async fn csv_query_array_agg_one() -> Result<()> {
161-
let ctx = SessionContext::new();
162-
register_aggregate_csv(&ctx).await?;
163-
let sql =
164-
"SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1) test";
165-
let actual = execute_to_batches(&ctx, sql).await;
166-
let expected = vec![
167-
"+----------------------------------+",
168-
"| ARRAYAGG(test.c13) |",
169-
"+----------------------------------+",
170-
"| [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm] |",
171-
"+----------------------------------+",
172-
];
173-
assert_batches_eq!(expected, &actual);
174-
Ok(())
175-
}
176-
177105
#[tokio::test]
178106
async fn csv_query_array_agg_unsupported() -> Result<()> {
179107
let ctx = SessionContext::new();

datafusion/core/tests/sql/arrow_typeof.rs

Lines changed: 0 additions & 139 deletions
This file was deleted.

datafusion/core/tests/sql/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ pub mod union;
104104
pub mod wildcard;
105105
pub mod window;
106106

107-
pub mod arrow_typeof;
108107
pub mod decimal;
109108
pub mod explain;
110109
pub mod idenfifers;

datafusion/core/tests/sqllogictests/test_files/aggregate.slt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -846,26 +846,23 @@ SELECT count(1 + 1)
846846
----
847847
1
848848

849-
# FIX: "CSV Writer does not support List(Field { name: \"item\", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: None }) data type")
850849
# csv_query_array_agg
851-
# query T
852-
# SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 2) test
853-
# ----
854-
# [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm0keZ5G8BffGwgF2RwQD59TFzMStxCB]
850+
query T
851+
SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 2) test
852+
----
853+
[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm, 0keZ5G8BffGwgF2RwQD59TFzMStxCB]
855854

856-
# FIX: see above
857855
# csv_query_array_agg_empty
858-
# query I
859-
# SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 LIMIT 0) test
860-
# ----
861-
# []
856+
query I
857+
SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 LIMIT 0) test
858+
----
859+
[]
862860

863-
# FIX: see above
864861
# csv_query_array_agg_one
865-
# query I
866-
# SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1) test
867-
# ----
868-
# [0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm]
862+
query I
863+
SELECT array_agg(c13) FROM (SELECT * FROM aggregate_test_100 ORDER BY c13 LIMIT 1) test
864+
----
865+
[0VVIHzxWtNOFLtnhjHEKjXaJOSLJfm]
869866

870867
# csv_query_array_agg_with_overflow
871868
query IIRIII
@@ -976,6 +973,7 @@ select max(c1) from d_table
976973
----
977974
110.009
978975

976+
# FIX: doesn't check datatype
979977
# aggregate_decimal_sum
980978
query R
981979
select sum(c1) from d_table

0 commit comments

Comments
 (0)