File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed
physical-expr/src/expressions Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 1818//! IS NOT NULL expression
1919
2020use crate :: PhysicalExpr ;
21- use arrow:: datatypes:: FieldRef ;
2221use arrow:: {
2322 datatypes:: { DataType , Schema } ,
2423 record_batch:: RecordBatch ,
@@ -94,10 +93,6 @@ impl PhysicalExpr for IsNotNullExpr {
9493 }
9594 }
9695
97- fn return_field ( & self , input_schema : & Schema ) -> Result < FieldRef > {
98- self . arg . return_field ( input_schema)
99- }
100-
10196 fn children ( & self ) -> Vec < & Arc < dyn PhysicalExpr > > {
10297 vec ! [ & self . arg]
10398 }
Original file line number Diff line number Diff line change 1818//! IS NULL expression
1919
2020use crate :: PhysicalExpr ;
21- use arrow:: datatypes:: FieldRef ;
2221use arrow:: {
2322 datatypes:: { DataType , Schema } ,
2423 record_batch:: RecordBatch ,
@@ -93,10 +92,6 @@ impl PhysicalExpr for IsNullExpr {
9392 }
9493 }
9594
96- fn return_field ( & self , input_schema : & Schema ) -> Result < FieldRef > {
97- self . arg . return_field ( input_schema)
98- }
99-
10095 fn children ( & self ) -> Vec < & Arc < dyn PhysicalExpr > > {
10196 vec ! [ & self . arg]
10297 }
Original file line number Diff line number Diff line change @@ -2131,3 +2131,26 @@ query T
21312131select E'foo\t\tbar';
21322132----
21332133foo bar
2134+
2135+ statement ok
2136+ create table t (a float) as values (1), (null), (3);
2137+
2138+ # https://github.com/apache/datafusion/issues/17055
2139+ # is not null did not correctly infer as boolean in udf argument position
2140+ query B
2141+ select greatest(a is not null, false) from t;
2142+ ----
2143+ true
2144+ false
2145+ true
2146+
2147+ # same for is null
2148+ query B
2149+ select greatest(a is null, false) from t;
2150+ ----
2151+ false
2152+ true
2153+ false
2154+
2155+ statement ok
2156+ drop table t;
You can’t perform that action at this time.
0 commit comments