jayzhan211 commented on code in PR #13356: URL: https://github.com/apache/datafusion/pull/13356#discussion_r1843282373
########## 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: Duckdb can run this query ``` D select nullif('2'::varchar, 2); ┌─────────────────────────────────┐ │ nullif(CAST('2' AS VARCHAR), 2) │ │ varchar │ ├─────────────────────────────────┤ │ │ └─────────────────────────────────┘ ``` 😕 -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org