databend icon indicating copy to clipboard operation
databend copied to clipboard

feat: to_decimal support more types

Open youngsofun opened this issue 4 weeks ago • 1 comments

now only support string

for other types return error like:

 select to_decimal(1.2::float, 3, 2);
error: APIError: QueryFailed: [1065]error: 
  --> SQL:1:8
  |
1 | select to_decimal(1.2::float, 3, 2)
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no function matches signature `to_decimal(3, 2)(Float32, UInt8, UInt8)`, you might need to add explicit type casts.

have to write as select to_decimal(3, 2)(1.2::float) or 1.2::float::decimal(3,2)

youngsofun avatar Nov 28 '25 07:11 youngsofun

https://docs.snowflake.com/en/sql-reference/functions/to_decimal

wubx avatar Nov 28 '25 09:11 wubx