caicancai commented on PR #44357:
URL: https://github.com/apache/spark/pull/44357#issuecomment-1873341258

   I found a bug when trying to push down date_add these date functions
   
   `date_add(date1, 1) = '2022-05-20'` will change `'2022-05-20' to 19132` 
before executing build(expr)
   
   ![2024-01-01 
21-57-49屏幕截图.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/492206df-c13c-4c16-a762-e7c31afd8176/530894a8-378c-4117-8c30-19797df1c3f9/2024-01-01_21-57-49%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)
   
   The problem is that an error occurs in V2ExpressionSQLBuilder
   
   ```scala
   case "=", "<>", "<=>", "<", "<=", ">", ">=" ->
                   visitBinaryComparison(name, inputToSQL(e.children()[0]), 
inputToSQL(e.children()[1]));
   ```
   
   Because inputToSQL(e.children()[1]) == inputToSQL(19132), but currently 
V2ExpressionSQLBuilder does not handle the situation accordingly.
   
   ![2024-01-01 
21-57-49屏幕截图.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/492206df-c13c-4c16-a762-e7c31afd8176/2cbd6870-0963-4dd5-8df1-ea4049d9e7a2/2024-01-01_21-57-49%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE.png)


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