You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Kyle Strand (Jira)" <ji...@apache.org> on 2020/09/14 17:19:00 UTC

[jira] [Commented] (ARROW-10002) [Rust] Trait-specialization requries nightly

    [ https://issues.apache.org/jira/browse/ARROW-10002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17195629#comment-17195629 ] 

Kyle Strand commented on ARROW-10002:
-------------------------------------

I have put together a repository with a minimal example of one way in which we're using specialization in the `array` module: [https://github.com/BatmanAoD/arrow-rust-specialization-alternatives]

The {{master}} branch shows how the code is written currently. This pull request shows how we could avoid specialization by introducing an "indexing" method associated with each primitive type: https://github.com/BatmanAoD/arrow-rust-specialization-alternatives/pull/1

> [Rust] Trait-specialization requries nightly
> --------------------------------------------
>
>                 Key: ARROW-10002
>                 URL: https://issues.apache.org/jira/browse/ARROW-10002
>             Project: Apache Arrow
>          Issue Type: Sub-task
>          Components: Rust
>            Reporter: Kyle Strand
>            Priority: Major
>
> Trait specialization is widely used in the Rust Arrow implementation. Uses can be identified by searching for instances of `default fn` in the codebase:
>  
> {code:java}
> $> rg -c 'default fn' ../arrow/rust/
>  ../arrow/rust/parquet/src/util/test_common/rand_gen.rs:1
>  ../arrow/rust/parquet/src/column/writer.rs:2
>  ../arrow/rust/parquet/src/encodings/encoding.rs:16
>  ../arrow/rust/parquet/src/arrow/record_reader.rs:1
>  ../arrow/rust/parquet/src/encodings/decoding.rs:13
>  ../arrow/rust/parquet/src/file/statistics.rs:1
>  ../arrow/rust/arrow/src/array/builder.rs:7
>  ../arrow/rust/arrow/src/array/array.rs:3
>  ../arrow/rust/arrow/src/array/equal.rs:3{code}
>  
> This feature requires Nightly Rust. Additionally, there is [no schedule for stabilization|https://github.com/rust-lang/rust/issues/31844#issue-135807289] , primarily due to an [unresolved soundness hole|[http://aturon.github.io/blog/2017/07/08/lifetime-dispatch]. (Note: there has been further discussion and ideas for resolving the soundness issue, but to my knowledge no definitive action.)|http://aturon.github.io/tech/2017/07/08/lifetime-dispatch/].]
> If we can remove specialization from the Rust codebase, we will not be blocked on the Rust team's stabilization of that feature in order to move to stable Rust.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)