{"id":17193403,"url":"https://github.com/mbrobbel/narrow","last_synced_at":"2025-04-07T17:09:13.172Z","repository":{"id":40462268,"uuid":"365007591","full_name":"mbrobbel/narrow","owner":"mbrobbel","description":"An experimental (work-in-progress) statically typed implementation of Apache Arrow","archived":false,"fork":false,"pushed_at":"2025-03-28T16:22:17.000Z","size":1369,"stargazers_count":18,"open_issues_count":21,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T15:18:33.759Z","etag":null,"topics":["apache-arrow"],"latest_commit_sha":null,"homepage":"https://mbrobbel.github.io/narrow/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrobbel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-06T18:50:00.000Z","updated_at":"2025-03-28T16:21:03.000Z","dependencies_parsed_at":"2024-01-08T13:56:51.143Z","dependency_job_id":"ba48ef46-43ed-4b5f-a20d-d2ed6dcc5990","html_url":"https://github.com/mbrobbel/narrow","commit_stats":{"total_commits":402,"total_committers":9,"mean_commits":"44.666666666666664","dds":0.3980099502487562,"last_synced_commit":"951e59da1b698070d09762d992ac0833dced4850"},"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrobbel%2Fnarrow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrobbel%2Fnarrow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrobbel%2Fnarrow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrobbel%2Fnarrow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrobbel","download_url":"https://codeload.github.com/mbrobbel/narrow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-arrow"],"created_at":"2024-10-15T01:44:03.435Z","updated_at":"2025-04-07T17:09:13.153Z","avatar_url":"https://github.com/mbrobbel.png","language":"Rust","readme":"![Narrow logo](https://raw.githubusercontent.com/mbrobbel/narrow/main/narrow.svg)\n\n[![crates.io](https://img.shields.io/crates/v/narrow.svg)](https://crates.io/crates/narrow)\n[![docs.rs](https://docs.rs/narrow/badge.svg)](https://docs.rs/narrow)\n\nAn experimental (work-in-progress) statically typed implementation of [Apache Arrow](https://arrow.apache.org).\n\nThis crate provides methods to automatically generate types to support reading and writing instances of abstract data types in Arrow's in-memory data structures.\n\n## Why\n\n- The [arrow](https://docs.rs/arrow) crate provides APIs that make sense when the array types are only known at run-time. Many of its [APIs](https://docs.rs/arrow/latest/arrow/#type-erasure--trait-objects) require the use of [trait objects](https://doc.rust-lang.org/book/ch17-02-trait-objects.html) and [downcasting](https://docs.rs/arrow/latest/arrow/array/fn.downcast_array.html). However, for applications where types are known at compile-time, these APIs are not ergonomic.\n- Builders for [nested](https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#method.is_nested) array types are [complex](https://docs.rs/arrow/latest/arrow/array/struct.StructBuilder.html) and error-prone.\n\nThere are [other crates](https://crates.io/search?q=arrow%20derive\u0026sort=relevance) that aim to prevent users from having to maintain array builder code by providing derive macros. These builders typically produce type-erased arrays, whereas this crate only provides fully statically typed arrays.\n\n### Goals and non-goals\n\n#### Goals\n\n- Provide production ready, fully statically typed, safe and efficient Arrow array implementations\n- Enable everyone using Rust to easily benefit from the Arrow ecosystem\n- Provide zero-copy interop with the [arrow](https://docs.rs/arrow) crate\n- Support custom buffer implementations e.g. to support accelerators\n- Explore expressing Arrow concepts using the Rust type system, and mapping Rust concepts to Arrow\n\n#### Non-goals\n\n- Support arbitrary array types at runtime (the [arrow](https://docs.rs/arrow) crate supports this use case)\n- Provide compute kernels\n- Replace other Arrow implementations\n\n# Example\n\n```rust\nuse narrow::{\n    array::{StructArray, UnionArray},\n    ArrayType, Length,\n};\n\n#[derive(ArrayType, Default, Clone, Debug, PartialEq, Eq)]\nstruct Foo {\n    a: bool,\n    b: u32,\n    c: Option\u003cString\u003e,\n}\n\n#[derive(ArrayType, Default, Clone, Debug, PartialEq, Eq)]\nstruct Bar(Vec\u003cu8\u003e);\n\n#[derive(ArrayType, Clone, Debug, PartialEq, Eq)]\nenum FooBar {\n    Foo(Foo),\n    Bar(Bar),\n    None,\n}\n\nlet foos = vec![\n    Foo {\n        a: false,\n        b: 0,\n        c: None,\n    },\n    Foo {\n        a: true,\n        b: 42,\n        c: Some(\"hello world\".to_owned()),\n    },\n];\nlet struct_array = foos.clone().into_iter().collect::\u003cStructArray\u003cFoo\u003e\u003e();\nassert_eq!(struct_array.len(), 2);\nassert!(struct_array.0.a.iter().any(|x| x));\nassert_eq!(struct_array.0.b.iter().sum::\u003cu32\u003e(), 42);\nassert_eq!(struct_array.0.c.iter().filter_map(|x| x).collect::\u003cString\u003e(), \"hello world\");\nassert_eq!(struct_array.into_iter().collect::\u003cVec\u003c_\u003e\u003e(), foos);\n\nlet foo_bars = vec![\n    FooBar::Foo(Foo {\n        a: true,\n        b: 42,\n        c: Some(\"hello world\".to_owned()),\n    }),\n    FooBar::Bar(Bar(vec![1, 2, 3, 4])),\n    FooBar::None,\n    FooBar::None,\n];\nlet union_array = foo_bars\n    .clone()\n    .into_iter()\n    .collect::\u003cUnionArray\u003cFooBar, 3\u003e\u003e();\nassert_eq!(union_array.len(), 4);\nassert_eq!(union_array.into_iter().collect::\u003cVec\u003c_\u003e\u003e(), foo_bars);\n```\n\n# Features\n\nThe crate supports the following optional features:\n\n## Derive support\n\n- `derive`: adds `ArrayType` derive support.\n\n## Interop\n\n- `arrow-rs`: array conversion methods for [arrow](https://docs.rs/arrow).\n\n## Additional `ArrayType` implementations\n\n- `chrono`: support for some [chrono](https://docs.rs/chrono) types.\n- `map`: support for [std::collections::HashMap](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html).\n- `uuid`: support for [uuid::Uuid](https://docs.rs/uuid/latest/uuid/struct.Uuid.html).\n\n# Docs\n\n- [Docs (release)](https://docs.rs/narrow)\n- [Docs (`main`)](https://mbrobbel.github.io/narrow/)\n\n# Minimum supported Rust version\n\nThe minimum supported Rust version for this crate is Rust 1.79.0.\n\n# License\n\nLicensed under either of [Apache License, Version 2.0](https://github.com/mbrobbel/narrow/blob/main/LICENSE-APACHE) or [MIT license](https://github.com/mbrobbel/narrow/blob/main/LICENSE-MIT) at your option.\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrobbel%2Fnarrow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrobbel%2Fnarrow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrobbel%2Fnarrow/lists"}