jayzhan211 commented on code in PR #13404:
URL: https://github.com/apache/datafusion/pull/13404#discussion_r1843017667


##########
datafusion/sqllogictest/test_files/expr.slt:
##########
@@ -510,6 +510,42 @@ SELECT ltrim(NULL, 'xyz')
 ----
 NULL
 
+# implicit casting with TypeSignature test
+query T
+SELECT ltrim(NULL, NULL)
+----
+NULL
+
+query T
+SELECT ltrim(12345, '1')

Review Comment:
   DuckDB doesn't allow this query 🤔 
   Numeric string casting is quite confusing to me
   
   ```
   D SELECT ltrim(12345, '1');
   Binder Error: No function matches the given name and argument types 
'ltrim(INTEGER_LITERAL, STRING_LITERAL)'. You might need to add explicit type 
casts.
        Candidate functions:
        ltrim(VARCHAR) -> VARCHAR
        ltrim(VARCHAR, VARCHAR) -> VARCHAR
   
   LINE 1: SELECT ltrim(12345, '1');
   ```
   
   Same with postgres
   
   ```
   postgres=# SELECT ltrim(12345, '1');
   ERROR:  function ltrim(integer, unknown) does not exist
   LINE 1: SELECT ltrim(12345, '1');
                  ^
   HINT:  No function matches the given name and argument types. You might need 
to add explicit type casts.
   ```



-- 
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]

Reply via email to