Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Veeupup committed Nov 21, 2023
1 parent be32301 commit e154ead
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
4 changes: 2 additions & 2 deletions datafusion/physical-expr/src/array_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ pub fn array_union(args: &[ArrayRef]) -> Result<ArrayRef> {
(_, _) => {
let list1 = array1.as_list::<i32>();
let list2 = array2.as_list::<i32>();
let result = union_generic_lists::<i32>(list1, list2, &l_field_ref)?;
let result = union_generic_lists::<i32>(list1, list2, l_field_ref)?;
Ok(Arc::new(result))
}
}
Expand All @@ -1531,7 +1531,7 @@ pub fn array_union(args: &[ArrayRef]) -> Result<ArrayRef> {
(_, _) => {
let list1 = array1.as_list::<i64>();
let list2 = array2.as_list::<i64>();
let result = union_generic_lists::<i64>(list1, list2, &l_field_ref)?;
let result = union_generic_lists::<i64>(list1, list2, l_field_ref)?;
Ok(Arc::new(result))
}
}
Expand Down
6 changes: 3 additions & 3 deletions datafusion/sql/src/expr/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
)?;

match value {
Expr::Literal(scalar) => {
values.push(Expr::Literal(scalar));
Expr::Literal(_) => {
values.push(value);
}
Expr::ScalarFunction(ref scalar_function) => {
if scalar_function.fun == BuiltinScalarFunction::MakeArray {
values.push(Expr::ScalarFunction(scalar_function.clone()));
values.push(value);
} else {
return not_impl_err!(
"ScalarFunctions without MakeArray are not supported: {value}"
Expand Down
22 changes: 0 additions & 22 deletions datafusion/sql/tests/sql_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,18 +1383,6 @@ fn select_interval_out_of_range() {
);
}

#[test]
fn select_array_no_common_type() {
let sql = "SELECT [1, true, null]";
let err = logical_plan(sql).expect_err("query should have failed");

// HashSet doesn't guarantee order
assert_contains!(
err.strip_backtrace(),
"This feature is not implemented: Arrays with different types are not supported: "
);
}

#[test]
fn recursive_ctes() {
let sql = "
Expand All @@ -1411,16 +1399,6 @@ fn recursive_ctes() {
);
}

#[test]
fn select_array_non_literal_type() {
let sql = "SELECT [now()]";
let err = logical_plan(sql).expect_err("query should have failed");
assert_eq!(
"This feature is not implemented: Arrays with elements other than literal are not supported: now()",
err.strip_backtrace()
);
}

#[test]
fn select_simple_aggregate_with_groupby_and_column_is_in_aggregate_and_groupby() {
quick_test(
Expand Down
4 changes: 2 additions & 2 deletions datafusion/sqllogictest/test_files/aggregate.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ SELECT COUNT(DISTINCT c1) FROM test
query ?
SELECT ARRAY_AGG([])
----
[]
[[]]

# array_agg_one
query ?
Expand All @@ -1419,7 +1419,7 @@ e 4
query ?
SELECT ARRAY_AGG([]);
----
[]
[[]]

# array_agg_one
query ?
Expand Down
8 changes: 8 additions & 0 deletions datafusion/sqllogictest/test_files/array.slt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ AS VALUES
(make_array([28, 29, 30], [31, 32, 33], [34, 35, 36], [28, 29, 30], [31, 32, 33], [34, 35, 36], [28, 29, 30], [31, 32, 33], [34, 35, 36], [28, 29, 30]), [28, 29, 30], [37, 38, 39], 10)
;

query ?
select [1, true, null]
----
[1, 1, ]

query error DataFusion error: This feature is not implemented: ScalarFunctions without MakeArray are not supported: now()
SELECT [now()]

query TTT
select arrow_typeof(column1), arrow_typeof(column2), arrow_typeof(column3) from arrays;
----
Expand Down

0 comments on commit e154ead

Please sign in to comment.