You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "suxiaogang223 (via GitHub)" <gi...@apache.org> on 2023/02/18 11:07:15 UTC

[GitHub] [arrow-rs] suxiaogang223 opened a new issue, #3735: Impl Parser for more types in arrow_array::types

suxiaogang223 opened a new issue, #3735:
URL: https://github.com/apache/arrow-rs/issues/3735

   **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*)
   -->
   The `Parser` has been impled for these arrow_array::types:
   https://docs.rs/arrow-cast/33.0.0/arrow_cast/parse/trait.Parser.html#foreign-impls
   Maybe we could impl `Parser` for more types, eg Decimal128 and Decimal256 and so on.
   Uniformly resolving the type interface can reduce much code.
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   Impl `Parser` for the types in https://docs.rs/arrow-array/33.0.0/arrow_array/types/index.html
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features you've considered.
   -->
   This may be required to add more methods to `Parser`.
   
   For example, to impl Parser for Decinal we should add this:
   ```rust
   pub trait Parser: ArrowPrimitiveType {
       fn parse(string: &str) -> Option<Self::Native>;
   
       fn parse_formatted(string: &str, _format: &str) -> Option<Self::Native> {
           Self::parse(string)
       }
   
       /// add for Parse Decimal
       fn parse_with_parameter(string: &str, _precision: u8, _scale: i8) -> Option<Self::Native> {
           Self::parse(string)
       }
   }
   ```
   
   Or consider making the parse function receive arbitrary arguments so that it can only need itself by `Parser`?
   
   **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-rs] tustvold commented on issue #3735: Impl Parser for more types in arrow_array::types

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on issue #3735:
URL: https://github.com/apache/arrow-rs/issues/3735#issuecomment-1439944887

   I think the parsing code would benefit from a more holistic rework, perhaps using #3647 as inspiration, I can add it to my list to write up a proper ticket for this


-- 
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-rs] suxiaogang223 closed issue #3735: Impl Parser for more types in arrow_array::types

Posted by "suxiaogang223 (via GitHub)" <gi...@apache.org>.
suxiaogang223 closed issue #3735: Impl Parser for more types in arrow_array::types
URL: https://github.com/apache/arrow-rs/issues/3735


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