You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/04/10 14:52:01 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5946: Remove `unsafe` code (`transmute`) in datafusion-proto

alamb commented on code in PR #5946:
URL: https://github.com/apache/arrow-datafusion/pull/5946#discussion_r1161789045


##########
datafusion/substrait/src/logical_plan/consumer.rs:
##########
@@ -453,7 +453,12 @@ pub async fn from_substrait_sorts(
         let asc_nullfirst = match &s.sort_kind {
             Some(k) => match k {
                 Direction(d) => {
-                    let direction: SortDirection = unsafe { ::std::mem::transmute(*d) };
+                    let Some(direction) = SortDirection::from_i32(*d) else {

Review Comment:
   The point of the PR is to remove all uses of `transmute` 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

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