jayzhan211 commented on code in PR #13356:
URL: https://github.com/apache/datafusion/pull/13356#discussion_r1839282117
##########
datafusion/sqllogictest/test_files/nullif.slt:
##########
@@ -97,11 +97,35 @@ SELECT NULLIF(1, 3);
----
1
-query I
+query T
SELECT NULLIF(NULL, NULL);
----
NULL
+query R
+select nullif(1, 1.2);
+----
+1
+
+query R
+select nullif(1.0, 2);
+----
+1
+
+query error DataFusion error: Error during planning: Internal error: Failed to
match any signature, errors: Error during planning: The signature expected
NativeType::String but received NativeType::Int64
+select nullif(2, 'a');
+
+
+query T
+select nullif('2', '3');
+----
+2
+
+# TODO: support numeric string
+# This query success in Postgres and DuckDB
+query error DataFusion error: Error during planning: Internal error: Failed to
match any signature, errors: Error during planning: The signature expected
NativeType::String but received NativeType::Int64
+select nullif(2, '1');
Review Comment:
This is quite a hard issue to fix, since we can't tell the difference
between Unknown type and String type currently
This query pass in `main` too but it should not.
```
query T
select nullif('1'::varchar, 2);
----
1
```
The change did have regression on `nullif(2, '1')`, but also fix
`nullif('1'::varchar, 2)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]