andygrove commented on issue #97:
URL: 
https://github.com/apache/datafusion-spark/issues/97#issuecomment-6865761057

   The integer-literal half of this affects users as well as tests. `date_add`, 
`date_sub` and `add_months` only accept INT, SMALLINT and TINYINT, and `space` 
only accepts INT, as in Spark. An unsuffixed integer literal is BIGINT here, so 
the obvious call fails to plan:
   
   ```sql
   SELECT date_add(DATE '2024-01-01', 1);
   -- Error during planning: ... coercion from Date32, Int64 to the signature 
OneOf(Exact(Date32, Int8), Exact(Date32, Int16), Exact(Date32, Int32)) failed
   SELECT space(2);
   -- Error during planning: ... coercion from Int64 to the signature 
Uniform(1, [Int32, ...]) failed
   ```
   
   In Spark the literal is INT, so both work. Until literals are typed as Spark 
types them, the workaround is `1::INT`. The docs in #105 and #106 say so. 
Widening the signatures to accept BIGINT would make these calls work, but Spark 
rejects a BIGINT column here, so it is better fixed in the literal typing.
   


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