Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rust edition 2021 #591

Merged
merged 1 commit into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ jobs:
export ARROW_TEST_DATA=$(pwd)/testing/data
export PARQUET_TEST_DATA=$(pwd)/parquet-testing/data

rustup toolchain install stable
rustup default stable
cargo install --version 0.18.2 cargo-tarpaulin
cargo tarpaulin --all --out Xml
- name: Report coverage
Expand Down
3 changes: 2 additions & 1 deletion arrow-flight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
name = "arrow-flight"
description = "Apache Arrow Flight"
version = "7.0.0-SNAPSHOT"
edition = "2018"
edition = "2021"
rust-version = "1.56"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
homepage = "https://github.com/apache/arrow-rs"
repository = "https://github.com/apache/arrow-rs"
Expand Down
3 changes: 2 additions & 1 deletion arrow-pyarrow-integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ repository = "https://github.com/apache/arrow-rs"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
license = "Apache-2.0"
keywords = [ "arrow" ]
edition = "2018"
edition = "2021"
rust-version = "1.56"

[lib]
name = "arrow_pyarrow_integration_testing"
Expand Down
3 changes: 2 additions & 1 deletion arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ include = [
"src/**/*.rs",
"Cargo.toml",
]
edition = "2018"
edition = "2021"
rust-version = "1.56"

[lib]
name = "arrow"
Expand Down
2 changes: 0 additions & 2 deletions arrow/src/array/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ fn build_extend_dictionary(
max: usize,
) -> Option<Extend> {
use crate::datatypes::*;
use std::convert::TryInto;

match array.data_type() {
DataType::Dictionary(child_data_type, _) => match child_data_type.as_ref() {
DataType::UInt8 => {
Expand Down
3 changes: 2 additions & 1 deletion arrow/test/dependency/default-features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
name = "defeault-features"
description = "Models a user application of arrow that uses default features of arrow"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion arrow/test/dependency/no-default-features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
name = "no-default-features"
description = "Models a user application of arrow that specifies no-default-features=true"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion arrow/test/dependency/simd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
name = "defeault-features"
description = "Models a user application of arrow that uses the simd feature of arrow"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ homepage = "https://github.com/apache/arrow-rs"
repository = "https://github.com/apache/arrow-rs"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
license = "Apache-2.0"
edition = "2018"
edition = "2021"
publish = false
rust-version = "1.56"

[features]
logging = ["tracing-subscriber"]
Expand Down
3 changes: 2 additions & 1 deletion parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ authors = ["Apache Arrow <dev@arrow.apache.org>"]
keywords = [ "arrow", "parquet", "hadoop" ]
readme = "README.md"
build = "build.rs"
edition = "2018"
edition = "2021"
rust-version = "1.56"

[dependencies]
# update note: pin `parquet-format` to specific version until it does not break at minor
Expand Down
3 changes: 2 additions & 1 deletion parquet_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ repository = "https://github.com/apache/arrow-rs"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
keywords = [ "parquet" ]
readme = "README.md"
edition = "2018"
edition = "2021"
rust-version = "1.56"

[lib]
proc-macro = true
Expand Down
14 changes: 11 additions & 3 deletions parquet_derive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ supported.
Derive also has some support for the chrono time library. You must must enable the `chrono` feature to get this support.

## Usage

Add this to your Cargo.toml:

```toml
[dependencies]
parquet = "7.0.0-SNAPSHOT"
parquet_derive = "7.0.0-SNAPSHOT"
```

and this to your crate root:

```rust
extern crate parquet;
#[macro_use] extern crate parquet_derive;
Expand Down Expand Up @@ -75,24 +78,29 @@ writer.close().unwrap();
```

## Features
- [X] Support writing `String`, `&str`, `bool`, `i32`, `f32`, `f64`, `Vec<u8>`

- [x] Support writing `String`, `&str`, `bool`, `i32`, `f32`, `f64`, `Vec<u8>`
- [ ] Support writing dictionaries
- [X] Support writing logical types like timestamp
- [X] Derive definition_levels for `Option`
- [x] Support writing logical types like timestamp
- [x] Derive definition_levels for `Option`
- [ ] Derive definition levels for nested structures
- [ ] Derive writing tuple struct
- [ ] Derive writing `tuple` container types

## Requirements

- Same as `parquet-rs`

## Test

Testing a `*_derive` crate requires an intermediate crate. Go to `parquet_derive_test` and run `cargo test` for
unit tests.

## Docs

To build documentation, run `cargo doc --no-deps`.
To compile and view in the browser, run `cargo doc --no-deps --open`.

## License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0.
4 changes: 2 additions & 2 deletions parquet_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern crate quote;

extern crate parquet;

use syn::{parse_macro_input, Data, DataStruct, DeriveInput};
use ::syn::{parse_macro_input, Data, DataStruct, DeriveInput};

mod parquet_field;

Expand Down Expand Up @@ -103,7 +103,7 @@ pub fn parquet_record_writer(input: proc_macro::TokenStream) -> proc_macro::Toke
impl #generics RecordWriter<#derived_for #generics> for &[#derived_for #generics] {
fn write_to_row_group(
&self,
row_group_writer: &mut Box<parquet::file::writer::RowGroupWriter>
row_group_writer: &mut Box<dyn parquet::file::writer::RowGroupWriter>
) -> Result<(), parquet::errors::ParquetError> {
let mut row_group_writer = row_group_writer;
let records = &self; // Used by all the writer snippets to be more clear
Expand Down
3 changes: 2 additions & 1 deletion parquet_derive/test/dependency/default-features/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
name = "defeault-features"
description = "Models a user application of parquet_derive that uses no additional features of arrow"
version = "0.1.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 3 additions & 2 deletions parquet_derive_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ homepage = "https://github.com/apache/arrow-rs"
repository = "https://github.com/apache/arrow-rs"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
keywords = [ "parquet" ]
edition = "2018"
edition = "2021"
publish = false
rust-version = "1.56"

[dependencies]
parquet = { path = "../parquet", version = "7.0.0-SNAPSHOT" }
parquet_derive = { path = "../parquet_derive", version = "7.0.0-SNAPSHOT" }
chrono = "0.4.19"
chrono = "0.4.19"
3 changes: 2 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.

edition = "2018"
edition = "2021"
rust-version = "1.56"
max_width = 90

# ignore generated files
Expand Down