Skip to content

Commit bfba28e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into split-out-arrow-schema
2 parents 3c3faf2 + 5b601b3 commit bfba28e

File tree

32 files changed

+1342
-566
lines changed

32 files changed

+1342
-566
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ __blobstorage__
2020

2121
# .bak files
2222
*.bak
23-
23+
*.bak2
2424
# OS-specific .gitignores
2525

2626
# Mac .gitignore

CHANGELOG-old.md

Lines changed: 114 additions & 1 deletion
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 86 additions & 97 deletions
Large diffs are not rendered by default.

arrow-buffer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
[package]
1919
name = "arrow-buffer"
20-
version = "22.0.0"
20+
version = "23.0.0"
2121
description = "Buffer abstractions for Apache Arrow"
2222
homepage = "https://github.com/apache/arrow-rs"
2323
repository = "https://github.com/apache/arrow-rs"

arrow-buffer/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
2020
pub mod alloc;
2121
pub mod buffer;
22+
pub use buffer::{Buffer, MutableBuffer};
23+
2224
mod bytes;
23-
pub mod native;
24-
pub mod util;
25+
mod native;
26+
27+
pub use native::*;
28+
mod util;
29+
pub use util::*;

arrow-flight/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "arrow-flight"
2020
description = "Apache Arrow Flight"
21-
version = "22.0.0"
21+
version = "23.0.0"
2222
edition = "2021"
2323
rust-version = "1.62"
2424
authors = ["Apache Arrow <[email protected]>"]
@@ -27,7 +27,7 @@ repository = "https://github.com/apache/arrow-rs"
2727
license = "Apache-2.0"
2828

2929
[dependencies]
30-
arrow = { path = "../arrow", version = "22.0.0", default-features = false, features = ["ipc"] }
30+
arrow = { path = "../arrow", version = "23.0.0", default-features = false, features = ["ipc"] }
3131
base64 = { version = "0.13", default-features = false }
3232
tonic = { version = "0.8", default-features = false, features = ["transport", "codegen", "prost"] }
3333
bytes = { version = "1", default-features = false }

arrow-flight/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Add this to your Cargo.toml:
2727

2828
```toml
2929
[dependencies]
30-
arrow-flight = "22.0.0"
30+
arrow-flight = "23.0.0"
3131
```
3232

3333
Apache Arrow Flight is a gRPC based protocol for exchanging Arrow data between processes. See the blog post [Introducing Apache Arrow Flight: A Framework for Fast Data Transport](https://arrow.apache.org/blog/2019/10/13/introducing-arrow-flight/) for more information.

arrow-pyarrow-integration-testing/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "arrow-pyarrow-integration-testing"
2020
description = ""
21-
version = "22.0.0"
21+
version = "23.0.0"
2222
homepage = "https://github.com/apache/arrow-rs"
2323
repository = "https://github.com/apache/arrow-rs"
2424
authors = ["Apache Arrow <[email protected]>"]
@@ -32,7 +32,7 @@ name = "arrow_pyarrow_integration_testing"
3232
crate-type = ["cdylib"]
3333

3434
[dependencies]
35-
arrow = { path = "../arrow", version = "22.0.0", features = ["pyarrow"] }
35+
arrow = { path = "../arrow", version = "23.0.0", features = ["pyarrow"] }
3636
pyo3 = { version = "0.17", features = ["extension-module"] }
3737

3838
[package.metadata.maturin]

arrow/Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
[package]
1919
name = "arrow"
20-
version = "22.0.0"
20+
version = "23.0.0"
2121
description = "Rust implementation of Apache Arrow"
2222
homepage = "https://github.com/apache/arrow-rs"
2323
repository = "https://github.com/apache/arrow-rs"
@@ -44,13 +44,13 @@ ahash = { version = "0.8", default-features = false, features = ["compile-time-r
4444
ahash = { version = "0.8", default-features = false, features = ["runtime-rng"] }
4545

4646
[dependencies]
47-
arrow-buffer = { path = "../arrow-buffer", version = "22.0.0" }
48-
arrow-schema = { version = "22.0.0", path = "../arrow-schema" }
47+
arrow-buffer = { version = "23.0.0", path = "../arrow-buffer" }
48+
arrow-schema = { version = "23.0.0", path = "../arrow-schema" }
4949
serde_json = { version = "1.0", default-features = false, features = ["std"], optional = true }
5050
indexmap = { version = "1.9", default-features = false, features = ["std"] }
5151
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true }
5252
num = { version = "0.4", default-features = false, features = ["std"] }
53-
half = { version = "2.0", default-features = false }
53+
half = { version = "2.0", default-features = false, features = ["num-traits"]}
5454
hashbrown = { version = "0.12", default-features = false }
5555
csv_crate = { version = "1.1", default-features = false, optional = true, package = "csv" }
5656
regex = { version = "1.5.6", default-features = false, features = ["std", "unicode"] }
@@ -239,3 +239,8 @@ harness = false
239239
name = "row_format"
240240
harness = false
241241
required-features = ["test_utils"]
242+
243+
[[bench]]
244+
name = "bitwise_kernel"
245+
harness = false
246+
required-features = ["test_utils"]

arrow/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This crate is tested with the latest stable version of Rust. We do not currently
3535

3636
The arrow crate follows the [SemVer standard](https://doc.rust-lang.org/cargo/reference/semver.html) defined by Cargo and works well within the Rust crate ecosystem.
3737

38-
However, for historical reasons, this crate uses versions with major numbers greater than `0.x` (e.g. `22.0.0`), unlike many other crates in the Rust ecosystem which spend extended time releasing versions `0.x` to signal planned ongoing API changes. Minor arrow releases contain only compatible changes, while major releases may contain breaking API changes.
38+
However, for historical reasons, this crate uses versions with major numbers greater than `0.x` (e.g. `23.0.0`), unlike many other crates in the Rust ecosystem which spend extended time releasing versions `0.x` to signal planned ongoing API changes. Minor arrow releases contain only compatible changes, while major releases may contain breaking API changes.
3939

4040
## Feature Flags
4141

@@ -61,7 +61,7 @@ The [Apache Arrow Status](https://arrow.apache.org/docs/status.html) page lists
6161

6262
## Safety
6363

64-
Arrow seeks to uphold the Rust Soundness Pledge as articulated eloquently [here](https://raphlinus.github.io/rust/22.0.01/18/soundness-pledge.html). Specifically:
64+
Arrow seeks to uphold the Rust Soundness Pledge as articulated eloquently [here](https://raphlinus.github.io/rust/23.0.01/18/soundness-pledge.html). Specifically:
6565

6666
> The intent of this crate is to be free of soundness bugs. The developers will do their best to avoid them, and welcome help in analyzing and fixing them
6767

arrow/benches/bitwise_kernel.rs

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#[macro_use]
19+
extern crate criterion;
20+
21+
use arrow::compute::kernels::bitwise::{
22+
bitwise_and, bitwise_and_scalar, bitwise_not, bitwise_or, bitwise_or_scalar,
23+
bitwise_xor, bitwise_xor_scalar,
24+
};
25+
use arrow::datatypes::Int64Type;
26+
use criterion::{black_box, Criterion};
27+
use rand::RngCore;
28+
29+
extern crate arrow;
30+
31+
use arrow::util::bench_util::create_primitive_array;
32+
use arrow::util::test_util::seedable_rng;
33+
34+
fn bitwise_array_benchmark(c: &mut Criterion) {
35+
let size = 64 * 1024_usize;
36+
let left_without_null = create_primitive_array::<Int64Type>(size, 0 as f32);
37+
let right_without_null = create_primitive_array::<Int64Type>(size, 0 as f32);
38+
let left_with_null = create_primitive_array::<Int64Type>(size, 0.2_f32);
39+
let right_with_null = create_primitive_array::<Int64Type>(size, 0.2_f32);
40+
// array and
41+
let mut group = c.benchmark_group("bench bitwise array: and");
42+
group.bench_function("bitwise array and, no nulls", |b| {
43+
b.iter(|| {
44+
black_box(bitwise_and(&left_without_null, &right_without_null).unwrap())
45+
})
46+
});
47+
group.bench_function("bitwise array and, 20% nulls", |b| {
48+
b.iter(|| black_box(bitwise_and(&left_with_null, &right_with_null).unwrap()))
49+
});
50+
group.finish();
51+
// array or
52+
let mut group = c.benchmark_group("bench bitwise: or");
53+
group.bench_function("bitwise array or, no nulls", |b| {
54+
b.iter(|| black_box(bitwise_or(&left_without_null, &right_without_null).unwrap()))
55+
});
56+
group.bench_function("bitwise array or, 20% nulls", |b| {
57+
b.iter(|| black_box(bitwise_or(&left_with_null, &right_with_null).unwrap()))
58+
});
59+
group.finish();
60+
// xor
61+
let mut group = c.benchmark_group("bench bitwise: xor");
62+
group.bench_function("bitwise array xor, no nulls", |b| {
63+
b.iter(|| {
64+
black_box(bitwise_xor(&left_without_null, &right_without_null).unwrap())
65+
})
66+
});
67+
group.bench_function("bitwise array xor, 20% nulls", |b| {
68+
b.iter(|| black_box(bitwise_xor(&left_with_null, &right_with_null).unwrap()))
69+
});
70+
group.finish();
71+
// not
72+
let mut group = c.benchmark_group("bench bitwise: not");
73+
group.bench_function("bitwise array not, no nulls", |b| {
74+
b.iter(|| black_box(bitwise_not(&left_without_null).unwrap()))
75+
});
76+
group.bench_function("bitwise array not, 20% nulls", |b| {
77+
b.iter(|| black_box(bitwise_not(&left_with_null).unwrap()))
78+
});
79+
group.finish();
80+
}
81+
82+
fn bitwise_array_scalar_benchmark(c: &mut Criterion) {
83+
let size = 64 * 1024_usize;
84+
let array_without_null = create_primitive_array::<Int64Type>(size, 0 as f32);
85+
let array_with_null = create_primitive_array::<Int64Type>(size, 0.2_f32);
86+
let scalar = seedable_rng().next_u64() as i64;
87+
// array scalar and
88+
let mut group = c.benchmark_group("bench bitwise array scalar: and");
89+
group.bench_function("bitwise array scalar and, no nulls", |b| {
90+
b.iter(|| black_box(bitwise_and_scalar(&array_without_null, scalar).unwrap()))
91+
});
92+
group.bench_function("bitwise array and, 20% nulls", |b| {
93+
b.iter(|| black_box(bitwise_and_scalar(&array_with_null, scalar).unwrap()))
94+
});
95+
group.finish();
96+
// array scalar or
97+
let mut group = c.benchmark_group("bench bitwise array scalar: or");
98+
group.bench_function("bitwise array scalar or, no nulls", |b| {
99+
b.iter(|| black_box(bitwise_or_scalar(&array_without_null, scalar).unwrap()))
100+
});
101+
group.bench_function("bitwise array scalar or, 20% nulls", |b| {
102+
b.iter(|| black_box(bitwise_or_scalar(&array_with_null, scalar).unwrap()))
103+
});
104+
group.finish();
105+
// array scalar xor
106+
let mut group = c.benchmark_group("bench bitwise array scalar: xor");
107+
group.bench_function("bitwise array scalar xor, no nulls", |b| {
108+
b.iter(|| black_box(bitwise_xor_scalar(&array_without_null, scalar).unwrap()))
109+
});
110+
group.bench_function("bitwise array scalar xor, 20% nulls", |b| {
111+
b.iter(|| black_box(bitwise_xor_scalar(&array_with_null, scalar).unwrap()))
112+
});
113+
group.finish();
114+
}
115+
116+
criterion_group!(
117+
benches,
118+
bitwise_array_benchmark,
119+
bitwise_array_scalar_benchmark
120+
);
121+
criterion_main!(benches);

arrow/benches/equal.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#[macro_use]
2222
extern crate criterion;
23+
use arrow::compute::eq_utf8_scalar;
2324
use criterion::Criterion;
2425

2526
extern crate arrow;
@@ -31,6 +32,10 @@ fn bench_equal<A: Array + PartialEq<A>>(arr_a: &A) {
3132
criterion::black_box(arr_a == arr_a);
3233
}
3334

35+
fn bench_equal_utf8_scalar(arr_a: &GenericStringArray<i32>, right: &str) {
36+
criterion::black_box(eq_utf8_scalar(arr_a, right).unwrap());
37+
}
38+
3439
fn add_benchmark(c: &mut Criterion) {
3540
let arr_a = create_primitive_array::<Float32Type>(512, 0.0);
3641
c.bench_function("equal_512", |b| b.iter(|| bench_equal(&arr_a)));
@@ -41,6 +46,11 @@ fn add_benchmark(c: &mut Criterion) {
4146
let arr_a = create_string_array::<i32>(512, 0.0);
4247
c.bench_function("equal_string_512", |b| b.iter(|| bench_equal(&arr_a)));
4348

49+
let arr_a = create_string_array::<i32>(512, 0.0);
50+
c.bench_function("equal_string_scalar_empty_512", |b| {
51+
b.iter(|| bench_equal_utf8_scalar(&arr_a, ""))
52+
});
53+
4454
let arr_a_nulls = create_string_array::<i32>(512, 0.5);
4555
c.bench_function("equal_string_nulls_512", |b| {
4656
b.iter(|| bench_equal(&arr_a_nulls))

arrow/src/bitmap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717

1818
//! Defines [Bitmap] for tracking validity bitmaps
1919
20-
use crate::buffer::Buffer;
2120
use crate::error::{ArrowError, Result};
2221
use crate::util::bit_util;
2322
use std::mem;
2423

25-
use arrow_buffer::buffer::{buffer_bin_and, buffer_bin_or};
24+
use arrow_buffer::buffer::{buffer_bin_and, buffer_bin_or, Buffer};
2625
use std::ops::{BitAnd, BitOr};
2726

2827
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)