Skip to content

Commit 2680c16

Browse files
committed
Split out arrow-data
1 parent 48cc8be commit 2680c16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4563
-4587
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
[workspace]
1919
members = [
2020
"arrow",
21+
"arrow-data",
2122
"arrow-schema",
2223
"arrow-buffer",
2324
"arrow-flight",

arrow-data/Cargo.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
[package]
19+
name = "arrow-data"
20+
version = "23.0.0"
21+
description = "Array data abstractions for Apache Arrow"
22+
homepage = "https://github.com/apache/arrow-rs"
23+
repository = "https://github.com/apache/arrow-rs"
24+
authors = ["Apache Arrow <[email protected]>"]
25+
license = "Apache-2.0"
26+
keywords = ["arrow"]
27+
include = [
28+
"benches/*.rs",
29+
"src/**/*.rs",
30+
"Cargo.toml",
31+
]
32+
edition = "2021"
33+
rust-version = "1.62"
34+
35+
[lib]
36+
name = "arrow_data"
37+
path = "src/lib.rs"
38+
bench = false
39+
40+
[features]
41+
# force_validate runs full data validation for all arrays that are created
42+
# this is not enabled by default as it is too computationally expensive
43+
# but is run as part of our CI checks
44+
force_validate = []
45+
46+
[dependencies]
47+
48+
arrow-buffer = { version = "23.0.0", path = "../arrow-buffer" }
49+
arrow-schema = { version = "23.0.0", path = "../arrow-schema" }
50+
51+
num = { version = "0.4", default-features = false, features = ["std"] }
52+
half = { version = "2.0", default-features = false }
53+
54+
[dev-dependencies]
55+
56+
[build-dependencies]

arrow/src/util/bit_iterator.rs renamed to arrow-data/src/bit_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use crate::util::bit_chunk_iterator::{UnalignedBitChunk, UnalignedBitChunkIterator};
18+
use arrow_buffer::bit_chunk_iterator::{UnalignedBitChunk, UnalignedBitChunkIterator};
1919
use std::result::Result;
2020

2121
/// Iterator of contiguous ranges of set bits within a provided packed bitmask

arrow/src/util/bit_mask.rs renamed to arrow-data/src/bit_mask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
//! Utils for working with packed bit masks
1919
20-
use crate::util::bit_chunk_iterator::BitChunks;
21-
use crate::util::bit_util::{ceil, get_bit, set_bit};
20+
use arrow_buffer::bit_chunk_iterator::BitChunks;
21+
use arrow_buffer::bit_util::{ceil, get_bit, set_bit};
2222

2323
/// Sets all bits on `write_data` in the range `[offset_write..offset_write+len]` to be equal to the
2424
/// bits in `data` in the range `[offset_read..offset_read+len]`

arrow/src/bitmap.rs renamed to arrow-data/src/bitmap.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
//! Defines [Bitmap] for tracking validity bitmaps
1919
20-
use crate::error::{ArrowError, Result};
21-
use crate::util::bit_util;
20+
use arrow_buffer::bit_util;
21+
use arrow_schema::ArrowError;
2222
use std::mem;
2323

2424
use arrow_buffer::buffer::{buffer_bin_and, buffer_bin_or, Buffer};
@@ -56,6 +56,10 @@ impl Bitmap {
5656
unsafe { bit_util::get_bit_raw(self.bits.as_ptr(), i) }
5757
}
5858

59+
pub fn buffer(&self) -> &Buffer {
60+
&self.bits
61+
}
62+
5963
pub fn buffer_ref(&self) -> &Buffer {
6064
&self.bits
6165
}
@@ -76,9 +80,9 @@ impl Bitmap {
7680
}
7781

7882
impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap {
79-
type Output = Result<Bitmap>;
83+
type Output = Result<Bitmap, ArrowError>;
8084

81-
fn bitand(self, rhs: &'b Bitmap) -> Result<Bitmap> {
85+
fn bitand(self, rhs: &'b Bitmap) -> Result<Bitmap, ArrowError> {
8286
if self.bits.len() != rhs.bits.len() {
8387
return Err(ArrowError::ComputeError(
8488
"Buffers must be the same size to apply Bitwise AND.".to_string(),
@@ -95,9 +99,9 @@ impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap {
9599
}
96100

97101
impl<'a, 'b> BitOr<&'b Bitmap> for &'a Bitmap {
98-
type Output = Result<Bitmap>;
102+
type Output = Result<Bitmap, ArrowError>;
99103

100-
fn bitor(self, rhs: &'b Bitmap) -> Result<Bitmap> {
104+
fn bitor(self, rhs: &'b Bitmap) -> Result<Bitmap, ArrowError> {
101105
if self.bits.len() != rhs.bits.len() {
102106
return Err(ArrowError::ComputeError(
103107
"Buffers must be the same size to apply Bitwise OR.".to_string(),

0 commit comments

Comments
 (0)