Skip to content

Commit

Permalink
remove print
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordworms committed Apr 5, 2024
1 parent af63709 commit 738c546
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
5 changes: 0 additions & 5 deletions datafusion/physical-expr/src/conditional_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ pub fn coalesce(args: &[ColumnarValue]) -> Result<ColumnarValue> {
}

let return_type = args[0].data_type();
println!(
"\n ************ \n return types are {:?} \n ************** \n",
return_type
);
let mut return_array = args.iter().filter_map(|x| match x {
ColumnarValue::Array(array) => Some(array.len()),
_ => None,
Expand All @@ -59,7 +55,6 @@ pub fn coalesce(args: &[ColumnarValue]) -> Result<ColumnarValue> {
continue;
} else {
let last_value = value.to_scalar()?;
println!("\n ******************** \n remainder is {:?}, last value is {:?}, current value is {:?} \n ************************ \n", remainder, last_value, current_value);
current_value = zip(&remainder, &last_value, &current_value)?;
break;
}
Expand Down
20 changes: 15 additions & 5 deletions datafusion/sqllogictest/test_files/scalar.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,18 @@ SELECT COALESCE(NULL, 'test')
----
test


statement ok
create table test1 as values (arrow_cast('foo', 'Dictionary(Int32, Utf8)')), (null);


query ?
select coalesce(column1, 'none_set') from test1;
----
foo
none_set


statement ok
CREATE TABLE test(
c1 INT,
Expand All @@ -1791,7 +1803,7 @@ CREATE TABLE test(
(NULL, NULL);

# coalesce result
query I rowsort
query I
SELECT COALESCE(c1, c2) FROM test
----
0
Expand All @@ -1801,14 +1813,14 @@ SELECT COALESCE(c1, c2) FROM test
NULL

# coalesce result with default value
query T rowsort
query T
SELECT COALESCE(c1, c2, '-1') FROM test
----
-1
0
1
1
1
-1

statement ok
drop table test
Expand Down Expand Up @@ -2162,5 +2174,3 @@ query I
select strpos('joséésoj', arrow_cast(null, 'Utf8'));
----
NULL


0 comments on commit 738c546

Please sign in to comment.