lgbo-ustc opened a new issue, #7630:
URL: https://github.com/apache/incubator-gluten/issues/7630

   ### Backend
   
   CH (ClickHouse)
   
   ### Bug description
   
   [Expected behavior] and [actual behavior].
   
   `CH` cannot cast a string of float number into an interge.
   
   ```sql
   f2386dc7dd0d :) select cast ('1e+05' as Double)
   
   SELECT CAST('1e+05', 'Double')
   
   Query id: 726166e3-3187-4390-87b8-d7b9d681fd92
   
      ┌─CAST('1e+05', 'Double')─┐
   1. │                  100000 │
      └─────────────────────────┘
   
   1 row in set. Elapsed: 0.001 sec.
   
   f2386dc7dd0d :) select cast ('100.0' as Double)
   
   SELECT CAST('100.0', 'Double')
   
   Query id: 4217d00e-eb1c-4480-b9b0-30d58c5f33f3
   
      ┌─CAST('100.0', 'Double')─┐
   1. │                     100 │
      └─────────────────────────┘
   
   1 row in set. Elapsed: 0.001 sec.
   ```
   
   but it fails on
   ```sql
   SELECT CAST('100.0', 'Int64')
   
   Query id: 99a558cc-0448-4bdd-8a39-f3adad80f1e9
   
   
   Elapsed: 0.032 sec.
   
   Received exception from server (version 24.10.1):
   Code: 6. DB::Exception: Received from localhost:9000. DB::Exception: Cannot 
parse string '100.0' as Int64: syntax error at position 3 (parsed just '100'). 
Note: there are toInt64OrZero and toInt64OrNull functions, which returns 
zero/NULL instead of throwing exception.: In scope SELECT CAST('100.0', 
'Int64'). (CANNOT_PARSE_TEXT)
   
   f2386dc7dd0d :) select cast ('1e+05' as Int64)
   
   SELECT CAST('1e+05', 'Int64')
   
   Query id: a99745cd-af1c-49b9-b0c8-e64a7659e20a
   
   
   Elapsed: 0.001 sec.
   
   Received exception from server (version 24.10.1):
   Code: 6. DB::Exception: Received from localhost:9000. DB::Exception: Cannot 
parse string '1e+05' as Int64: syntax error at position 1 (parsed just '1'). 
Note: there are toInt64OrZero and toInt64OrNull functions, which returns 
zero/NULL instead of throwing exception.: In scope SELECT CAST('1e+05', 
'Int64'). (CANNOT_PARSE_TEXT)
   ```
   
   
   ### Spark version
   
   None
   
   ### Spark configurations
   
   _No response_
   
   ### System information
   
   _No response_
   
   ### Relevant logs
   
   _No response_


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