You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/14 12:48:48 UTC

[GitHub] [arrow-datafusion] kmitchener opened a new issue, #3478: add support for casting string to decimal

kmitchener opened a new issue, #3478:
URL: https://github.com/apache/arrow-datafusion/issues/3478

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for this feature, in addition to  the *what*)
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   Would like to be able to cast string to decimal as is supported by float types.
   
   ```sql
   ❯ select arrow_typeof('1.1'::decimal);
   Internal("Unsupported CAST from Utf8 to Decimal128(38, 10)")
   ```
   
   but should work like it does for float:
   ```sql
   ❯ select arrow_typeof('1.1'::double);
   +--------------------------+
   | arrowtypeof(Utf8("1.1")) |
   +--------------------------+
   | Float64                  |
   +--------------------------+
   1 row in set. Query took 0.010 seconds.
   ```
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] Dandandan closed issue #3478: add support for casting string to decimal

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan closed issue #3478: add support for casting string to decimal
URL: https://github.com/apache/arrow-datafusion/issues/3478


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on issue #3478: add support for casting string to decimal

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #3478:
URL: https://github.com/apache/arrow-datafusion/issues/3478#issuecomment-1314360585

   Here is a PR to add the appropriate support in arrow-rs: https://github.com/apache/arrow-rs/pull/3106 👍 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] liukun4515 commented on issue #3478: add support for casting string to decimal

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on issue #3478:
URL: https://github.com/apache/arrow-datafusion/issues/3478#issuecomment-1247424923

   about the cast, you can refer the  https://github.com/apache/arrow-rs/issues/1043  https://github.com/apache/arrow-datafusion/issues/1443
   
   we don't support the cast/try_cast from decimal to utf8 or utf8 to decimal
   
   you can implement this in the arrow-rs kernel about the cast.
   @kmitchener 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] add support for casting string to decimal [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #3478:
URL: https://github.com/apache/datafusion/issues/3478#issuecomment-2143560997

   The 38 is the maximum precision of Decimal128 in arrow
   
   https://docs.rs/arrow-schema/51.0.0/src/arrow_schema/datatype.rs.html#676
   
   The 10 is the default scale: https://docs.rs/arrow-schema/51.0.0/src/arrow_schema/datatype.rs.html#689
   
   


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] add support for casting string to decimal [datafusion]

Posted by "finlaydotb (via GitHub)" <gi...@apache.org>.
finlaydotb commented on issue #3478:
URL: https://github.com/apache/datafusion/issues/3478#issuecomment-2143466497

   > ```
   > ❯ select arrow_typeof('1.1'::decimal);
   > +--------------------------+
   > | arrowtypeof(Utf8("1.1")) |
   > +--------------------------+
   > | Decimal128(38, 10)       |
   > +--------------------------+
   > 1 row in set. Query took 0.030 seconds.
   > ```
   
   Maybe someone can help clarify...Why does this come out as `Decimal128(38, 10)`? Where is the `38` and `10` coming from


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


[GitHub] [arrow-datafusion] Dandandan commented on issue #3478: add support for casting string to decimal

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on issue #3478:
URL: https://github.com/apache/arrow-datafusion/issues/3478#issuecomment-1564316926

   ```
   ❯ select arrow_typeof('1.1'::decimal);
   +--------------------------+
   | arrowtypeof(Utf8("1.1")) |
   +--------------------------+
   | Decimal128(38, 10)       |
   +--------------------------+
   1 row in set. Query took 0.030 seconds.
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org