You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@arrow.apache.org by Louis C <lc...@outlook.fr> on 2022/07/26 09:19:08 UTC

[C++] Scalar cast of MAP and LIST to STRING

Hello,

I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
Is there a particular reason why it is the case ?
Is it planned to make it work ?

Best regards
Louis C

RE: [C++] Scalar cast of MAP and LIST to STRING

Posted by Louis C <lc...@outlook.fr>.
I ended up making the changes needed on my side, and made a corresponding pull request at https://github.com/apache/arrow/pull/13737.
Feel free to comment.
[https://opengraph.githubassets.com/9785ecdef3889fd9e28046b5e8a6cc4456efef233665fb3bdeeeef621efbb0ff/apache/arrow/pull/13737]<https://github.com/apache/arrow/pull/13737>
Add scalar casts to string types for list based types by LouisClt · Pull Request #13737 · apache/arrow<https://github.com/apache/arrow/pull/13737>
Following https://lists.apache.org/thread/rp7vpjtt4lgtjxj35oyjyqh9b6on94jf discussion, here is the PR corresponding to the feature : be able to cast list-like types (maps, lists, fixed-size lists) ...
github.com

________________________________
De : Louis C <lc...@outlook.fr>
Envoyé : jeudi 28 juillet 2022 09:13
À : user@arrow.apache.org <us...@arrow.apache.org>
Objet : RE: [C++] Scalar cast of MAP and LIST to STRING

Hello Wes,
Thanks for your answer, I may look into it if I find time to do it then.

Best regards,
Louis
________________________________
De : Wes McKinney <we...@gmail.com>
Envoyé : mercredi 27 juillet 2022 18:41
À : user@arrow.apache.org <us...@arrow.apache.org>
Objet : Re: [C++] Scalar cast of MAP and LIST to STRING

hi Louis -- it's hard to say. Since this project is developed by
volunteers, the issue would generally be completed by someone who
needs the feature. If you would like to try to submit a PR for this,
it may not be a large amount of work to implement.

- Wes

On Wed, Jul 27, 2022 at 7:47 AM Louis C <lc...@outlook.fr> wrote:
>
> Hello,
>
> Thanks for you answer and support. Do you have any rough idea when this will be available ?
>
> Thanks
> Louis
> ________________________________
> De : David Li <li...@apache.org>
> Envoyé : mardi 26 juillet 2022 17:22
> À : dl <us...@arrow.apache.org>
> Objet : Re: [C++] Scalar cast of MAP and LIST to STRING
>
> Hi Louis,
>
> It just happens they aren't implemented, I don't think there's any particular reason. I've filed ARROW-17214 [1] to track this.
>
> [1]: https://issues.apache.org/jira/browse/ARROW-17214
>
> -David
>
> On Tue, Jul 26, 2022, at 05:19, Louis C wrote:
>
> Hello,
>
> I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
> However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
> Is there a particular reason why it is the case ?
> Is it planned to make it work ?
>
> Best regards
> Louis C
>
>

RE: [C++] Scalar cast of MAP and LIST to STRING

Posted by Louis C <lc...@outlook.fr>.
Hello Wes,
Thanks for your answer, I may look into it if I find time to do it then.

Best regards,
Louis
________________________________
De : Wes McKinney <we...@gmail.com>
Envoyé : mercredi 27 juillet 2022 18:41
À : user@arrow.apache.org <us...@arrow.apache.org>
Objet : Re: [C++] Scalar cast of MAP and LIST to STRING

hi Louis -- it's hard to say. Since this project is developed by
volunteers, the issue would generally be completed by someone who
needs the feature. If you would like to try to submit a PR for this,
it may not be a large amount of work to implement.

- Wes

On Wed, Jul 27, 2022 at 7:47 AM Louis C <lc...@outlook.fr> wrote:
>
> Hello,
>
> Thanks for you answer and support. Do you have any rough idea when this will be available ?
>
> Thanks
> Louis
> ________________________________
> De : David Li <li...@apache.org>
> Envoyé : mardi 26 juillet 2022 17:22
> À : dl <us...@arrow.apache.org>
> Objet : Re: [C++] Scalar cast of MAP and LIST to STRING
>
> Hi Louis,
>
> It just happens they aren't implemented, I don't think there's any particular reason. I've filed ARROW-17214 [1] to track this.
>
> [1]: https://issues.apache.org/jira/browse/ARROW-17214
>
> -David
>
> On Tue, Jul 26, 2022, at 05:19, Louis C wrote:
>
> Hello,
>
> I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
> However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
> Is there a particular reason why it is the case ?
> Is it planned to make it work ?
>
> Best regards
> Louis C
>
>

Re: [C++] Scalar cast of MAP and LIST to STRING

Posted by Wes McKinney <we...@gmail.com>.
hi Louis -- it's hard to say. Since this project is developed by
volunteers, the issue would generally be completed by someone who
needs the feature. If you would like to try to submit a PR for this,
it may not be a large amount of work to implement.

- Wes

On Wed, Jul 27, 2022 at 7:47 AM Louis C <lc...@outlook.fr> wrote:
>
> Hello,
>
> Thanks for you answer and support. Do you have any rough idea when this will be available ?
>
> Thanks
> Louis
> ________________________________
> De : David Li <li...@apache.org>
> Envoyé : mardi 26 juillet 2022 17:22
> À : dl <us...@arrow.apache.org>
> Objet : Re: [C++] Scalar cast of MAP and LIST to STRING
>
> Hi Louis,
>
> It just happens they aren't implemented, I don't think there's any particular reason. I've filed ARROW-17214 [1] to track this.
>
> [1]: https://issues.apache.org/jira/browse/ARROW-17214
>
> -David
>
> On Tue, Jul 26, 2022, at 05:19, Louis C wrote:
>
> Hello,
>
> I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
> However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
> Is there a particular reason why it is the case ?
> Is it planned to make it work ?
>
> Best regards
> Louis C
>
>

RE: [C++] Scalar cast of MAP and LIST to STRING

Posted by Louis C <lc...@outlook.fr>.
Hello,

Thanks for you answer and support. Do you have any rough idea when this will be available ?

Thanks
Louis
________________________________
De : David Li <li...@apache.org>
Envoyé : mardi 26 juillet 2022 17:22
À : dl <us...@arrow.apache.org>
Objet : Re: [C++] Scalar cast of MAP and LIST to STRING

Hi Louis,

It just happens they aren't implemented, I don't think there's any particular reason. I've filed ARROW-17214 [1] to track this.

[1]: https://issues.apache.org/jira/browse/ARROW-17214

-David

On Tue, Jul 26, 2022, at 05:19, Louis C wrote:
Hello,

I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
Is there a particular reason why it is the case ?
Is it planned to make it work ?

Best regards
Louis C


Re: [C++] Scalar cast of MAP and LIST to STRING

Posted by David Li <li...@apache.org>.
Hi Louis,

It just happens they aren't implemented, I don't think there's any particular reason. I've filed ARROW-17214 [1] to track this. 

[1]: https://issues.apache.org/jira/browse/ARROW-17214

-David

On Tue, Jul 26, 2022, at 05:19, Louis C wrote:
> Hello,
> 
> I use scalar casts to STRING type as a way to represent easily the more complex arrow types such as STRUCT or UNION. For these types, the Scalar cast (CastTo method) is correctly implemented, giving results such as :"union{1: bool = false}"
> However, when casting LIST, LARGE_LIST or MAP types, it gives NotImplemented error.
> Is there a particular reason why it is the case ?
> Is it planned to make it work ?
> 
> Best regards
> Louis C