Skip to content

Commit 9799439

Browse files
committed
Split out arrow-string (apache#2594)
1 parent 99ced48 commit 9799439

File tree

11 files changed

+2534
-2126
lines changed

11 files changed

+2534
-2126
lines changed

Cargo.toml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@
1717

1818
[workspace]
1919
members = [
20-
"arrow",
21-
"arrow-array",
22-
"arrow-buffer",
23-
"arrow-cast",
24-
"arrow-csv",
25-
"arrow-data",
26-
"arrow-flight",
27-
"arrow-integration-test",
28-
"arrow-integration-testing",
29-
"arrow-ipc",
30-
"arrow-json",
31-
"arrow-schema",
32-
"arrow-select",
33-
"object_store",
34-
"parquet",
35-
"parquet_derive",
36-
"parquet_derive_test",
20+
"arrow",
21+
"arrow-array",
22+
"arrow-buffer",
23+
"arrow-cast",
24+
"arrow-csv",
25+
"arrow-data",
26+
"arrow-flight",
27+
"arrow-integration-test",
28+
"arrow-integration-testing",
29+
"arrow-ipc",
30+
"arrow-json",
31+
"arrow-schema",
32+
"arrow-select",
33+
"arrow-string",
34+
"object_store",
35+
"parquet",
36+
"parquet_derive",
37+
"parquet_derive_test",
3738
]
3839
# Enable the version 2 feature resolver, which avoids unifying features for targets that are not being built
3940
#

arrow-string/Cargo.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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-string"
20+
version = "28.0.0"
21+
description = "String kernels for arrow arrays"
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_string"
37+
path = "src/lib.rs"
38+
bench = false
39+
40+
[dependencies]
41+
arrow-buffer = { version = "28.0.0", path = "../arrow-buffer" }
42+
arrow-data = { version = "28.0.0", path = "../arrow-data" }
43+
arrow-schema = { version = "28.0.0", path = "../arrow-schema" }
44+
arrow-array = { version = "28.0.0", path = "../arrow-array" }
45+
regex = { version = "1.7.0", default-features = false, features = ["std", "unicode", "perf"] }
46+
regex-syntax = { version = "0.6.27", default-features = false, features = ["unicode"] }
47+
48+
[features]
49+
dyn_cmp_dict = []

arrow/src/compute/kernels/concat_elements.rs renamed to arrow-string/src/concat_elements.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use crate::array::*;
19-
use crate::error::{ArrowError, Result};
18+
19+
use arrow_array::{Array, GenericStringArray, OffsetSizeTrait};
20+
use arrow_array::builder::BufferBuilder;
21+
use arrow_data::ArrayDataBuilder;
2022
use arrow_data::bit_mask::combine_option_bitmap;
23+
use arrow_schema::ArrowError;
2124

2225
/// Returns the elementwise concatenation of a [`StringArray`].
2326
///
@@ -36,7 +39,7 @@ use arrow_data::bit_mask::combine_option_bitmap;
3639
pub fn concat_elements_utf8<Offset: OffsetSizeTrait>(
3740
left: &GenericStringArray<Offset>,
3841
right: &GenericStringArray<Offset>,
39-
) -> Result<GenericStringArray<Offset>> {
42+
) -> Result<GenericStringArray<Offset>, ArrowError> {
4043
if left.len() != right.len() {
4144
return Err(ArrowError::ComputeError(format!(
4245
"Arrays must have the same length: {} != {}",
@@ -89,7 +92,7 @@ pub fn concat_elements_utf8<Offset: OffsetSizeTrait>(
8992
/// An error will be returned if the [`StringArray`] are of different lengths
9093
pub fn concat_elements_utf8_many<Offset: OffsetSizeTrait>(
9194
arrays: &[&GenericStringArray<Offset>],
92-
) -> Result<GenericStringArray<Offset>> {
95+
) -> Result<GenericStringArray<Offset>, ArrowError> {
9396
if arrays.is_empty() {
9497
return Err(ArrowError::ComputeError(
9598
"concat requires input of at least one array".to_string(),
@@ -157,6 +160,7 @@ pub fn concat_elements_utf8_many<Offset: OffsetSizeTrait>(
157160

158161
#[cfg(test)]
159162
mod tests {
163+
use arrow_array::StringArray;
160164
use super::*;
161165
#[test]
162166
fn test_string_concat() {

0 commit comments

Comments
 (0)