You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "c-thiel (via GitHub)" <gi...@apache.org> on 2023/04/05 17:16:40 UTC

[GitHub] [arrow-rs] c-thiel opened a new issue, #4022: Implement TryFrom for Arrow Flight protobuf Enums

c-thiel opened a new issue, #4022:
URL: https://github.com/apache/arrow-rs/issues/4022

   **Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
   I am trying to implement a flight server.
   As such, for example in the ``get_flight_info_sql_info`` method, we get a ``CommandGetSqlInfo`` result.
   It's `.info` field is of type `Vec<u32>`. I would like to get the original Semantic (enum) back, so a `Vec<SqlInfo>`
   
   
   **Describe the solution you'd like**
   Implement TryFrom or something similar to get the enum back from the primitive.
   Prost might even be able to generate this by adding `#[derive(::prost::Enumeration)]`:
   https://docs.rs/prost/0.11.8/prost/index.html 
   
   
   **Describe alternatives you've considered**
   Match all cases manually.
   
   


-- 
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] c-thiel commented on issue #4022: Implement TryFrom for Arrow Flight protobuf Enums

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

   Actually, this might be a bug. I see `#[derive(::prost::Enumeration)]` is already implemented. The Problem is that SqlInfo is an `i32` while CommandGetSqlInfo is a vec of `u32`. This should be compatible.
   
   https://github.com/apache/arrow-rs/blob/2b2ce2f93b6c1798ef04658b286353b71d17682e/arrow-flight/src/sql/arrow.flight.protocol.sql.rs#L561-L563
   
   https://github.com/apache/arrow-rs/blob/2b2ce2f93b6c1798ef04658b286353b71d17682e/arrow-flight/src/sql/arrow.flight.protocol.sql.rs#L42-L43


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