Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Rename arrow2 -> re_arrow2
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 15, 2024
1 parent 40541b4 commit a602463
Show file tree
Hide file tree
Showing 276 changed files with 964 additions and 956 deletions.
2 changes: 1 addition & 1 deletion arrow-odbc-integration-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
mod read;
mod write;

use arrow2::io::odbc::api::{Connection, Environment, Error as OdbcError};
use lazy_static::lazy_static;
use re_arrow2::io::odbc::api::{Connection, Environment, Error as OdbcError};

lazy_static! {
/// This is an example for using doc comment attributes
Expand Down
12 changes: 6 additions & 6 deletions arrow-odbc-integration-testing/src/read.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use stdext::function_name;

use arrow2::array::{Array, BinaryArray, BooleanArray, Int32Array, Int64Array, Utf8Array};
use arrow2::chunk::Chunk;
use arrow2::datatypes::{DataType, Field, TimeUnit};
use arrow2::error::Result;
use arrow2::io::odbc::api::{Connection, Cursor};
use arrow2::io::odbc::read::{buffer_from_metadata, deserialize, infer_schema};
use re_arrow2::array::{Array, BinaryArray, BooleanArray, Int32Array, Int64Array, Utf8Array};
use re_arrow2::chunk::Chunk;
use re_arrow2::datatypes::{DataType, Field, TimeUnit};
use re_arrow2::error::Result;
use re_arrow2::io::odbc::api::{Connection, Cursor};
use re_arrow2::io::odbc::read::{buffer_from_metadata, deserialize, infer_schema};

use super::{setup_empty_table, ENV, MSSQL};

Expand Down
10 changes: 5 additions & 5 deletions arrow-odbc-integration-testing/src/write.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use stdext::function_name;

use arrow2::array::{Array, BinaryArray, BooleanArray, Int32Array, Utf8Array};
use arrow2::chunk::Chunk;
use arrow2::datatypes::{DataType, Field};
use arrow2::error::Result;
use arrow2::io::odbc::write::{buffer_from_description, infer_descriptions, serialize};
use re_arrow2::array::{Array, BinaryArray, BooleanArray, Int32Array, Utf8Array};
use re_arrow2::chunk::Chunk;
use re_arrow2::datatypes::{DataType, Field};
use re_arrow2::error::Result;
use re_arrow2::io::odbc::write::{buffer_from_description, infer_descriptions, serialize};

use super::read::read;
use super::{setup_empty_table, ENV, MSSQL};
Expand Down
10 changes: 5 additions & 5 deletions arrow-parquet-integration-testing/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use std::fs::File;
use std::io::Read;

use arrow2::array::Array;
use arrow2::io::ipc::IpcField;
use arrow2::{
use clap::Parser;
use flate2::read::GzDecoder;
use re_arrow2::array::Array;
use re_arrow2::io::ipc::IpcField;
use re_arrow2::{
chunk::Chunk,
datatypes::{DataType, Schema},
error::Result,
Expand All @@ -17,8 +19,6 @@ use arrow2::{
},
AHashMap,
};
use clap::Parser;
use flate2::read::GzDecoder;

/// Read gzipped JSON file
pub fn read_gzip_json(
Expand Down
6 changes: 3 additions & 3 deletions arrow-pyarrow-integration-testing/src/c_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
use pyo3::ffi::Py_uintptr_t;
use pyo3::prelude::*;

use arrow2::array::{Int32Array, StructArray};
use arrow2::datatypes::DataType;
use arrow2::ffi;
use re_arrow2::array::{Int32Array, StructArray};
use re_arrow2::datatypes::DataType;
use re_arrow2::ffi;

use super::*;

Expand Down
8 changes: 4 additions & 4 deletions arrow-pyarrow-integration-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use pyo3::ffi::Py_uintptr_t;
use pyo3::prelude::*;
use pyo3::wrap_pyfunction;

use arrow2::{array::Array, datatypes::Field, error::Error, ffi};
use re_arrow2::{array::Array, datatypes::Field, error::Error, ffi};

/// an error that bridges Error with a Python error
#[derive(Debug)]
Expand Down Expand Up @@ -80,8 +80,8 @@ fn to_py_array(array: Box<dyn Array>, py: Python) -> PyResult<PyObject> {
)));
let array = Box::new(ffi::export_array_to_c(array));

let schema_ptr: *const arrow2::ffi::ArrowSchema = &*schema;
let array_ptr: *const arrow2::ffi::ArrowArray = &*array;
let schema_ptr: *const re_arrow2::ffi::ArrowSchema = &*schema;
let array_ptr: *const re_arrow2::ffi::ArrowArray = &*array;

let pa = py.import("pyarrow")?;

Expand Down Expand Up @@ -110,7 +110,7 @@ fn to_rust_field(ob: PyObject, py: Python) -> PyResult<Field> {

fn to_py_field(field: &Field, py: Python) -> PyResult<PyObject> {
let schema = Box::new(ffi::export_field_to_c(field));
let schema_ptr: *const arrow2::ffi::ArrowSchema = &*schema;
let schema_ptr: *const re_arrow2::ffi::ArrowSchema = &*schema;

let pa = py.import("pyarrow")?;

Expand Down
6 changes: 3 additions & 3 deletions benches/aggregate.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::*;
use arrow2::compute::aggregate::*;
use arrow2::util::bench_util::*;
use re_arrow2::array::*;
use re_arrow2::compute::aggregate::*;
use re_arrow2::util::bench_util::*;

fn bench_sum(arr_a: &dyn Array) {
sum(criterion::black_box(arr_a)).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions benches/arithmetic_kernels.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use arrow2::compute::arithmetics::basic::NativeArithmetics;
use criterion::{criterion_group, criterion_main, Criterion};
use re_arrow2::compute::arithmetics::basic::NativeArithmetics;

use arrow2::array::*;
use arrow2::util::bench_util::*;
use arrow2::{compute::arithmetics::basic::add, compute::arithmetics::basic::div_scalar};
use num_traits::NumCast;
use re_arrow2::array::*;
use re_arrow2::util::bench_util::*;
use re_arrow2::{compute::arithmetics::basic::add, compute::arithmetics::basic::div_scalar};
use std::ops::{Add, Div};

fn bench_div_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T)
Expand Down
4 changes: 2 additions & 2 deletions benches/assign_ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::compute::arity_assign::{binary, unary};
use arrow2::{
use re_arrow2::compute::arity_assign::{binary, unary};
use re_arrow2::{
compute::arithmetics::basic::{mul, mul_scalar},
util::bench_util::*,
};
Expand Down
6 changes: 3 additions & 3 deletions benches/avro_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use std::io::Cursor;
use avro_rs::types::Record;
use criterion::*;

use arrow2::error::Result;
use arrow2::io::avro::avro_schema::read::read_metadata;
use arrow2::io::avro::read;
use avro_rs::*;
use avro_rs::{Codec, Schema as AvroSchema};
use re_arrow2::error::Result;
use re_arrow2::io::avro::avro_schema::read::read_metadata;
use re_arrow2::io::avro::read;

fn schema() -> AvroSchema {
let raw_schema = r#"
Expand Down
2 changes: 1 addition & 1 deletion benches/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::iter::FromIterator;

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::*;
use re_arrow2::bitmap::*;

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
4 changes: 2 additions & 2 deletions benches/bitmap_assign_ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::{binary_assign, unary_assign};
use arrow2::bitmap::{Bitmap, MutableBitmap};
use re_arrow2::bitmap::{binary_assign, unary_assign};
use re_arrow2::bitmap::{Bitmap, MutableBitmap};

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
2 changes: 1 addition & 1 deletion benches/bitmap_ops.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::Bitmap;
use re_arrow2::bitmap::Bitmap;

fn bench_arrow2(lhs: &Bitmap, rhs: &Bitmap) {
let r = lhs | rhs;
Expand Down
2 changes: 1 addition & 1 deletion benches/bitwise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::ops::{BitAnd, BitOr, BitXor, Not};
use criterion::{criterion_group, criterion_main, Criterion};
use num_traits::NumCast;

use arrow2::{
use re_arrow2::{
array::PrimitiveArray, compute::bitwise::*, types::NativeType,
util::bench_util::create_primitive_array_with_seed,
};
Expand Down
8 changes: 4 additions & 4 deletions benches/cast_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ use criterion::{criterion_group, criterion_main, Criterion};
use rand::distributions::Uniform;
use rand::Rng;

use arrow2::array::*;
use arrow2::compute::cast;
use arrow2::datatypes::*;
use arrow2::util::bench_util::*;
use re_arrow2::array::*;
use re_arrow2::compute::cast;
use re_arrow2::datatypes::*;
use re_arrow2::util::bench_util::*;

fn build_utf8_date_array(size: usize, with_nulls: bool) -> Utf8Array<i32> {
use chrono::NaiveDate;
Expand Down
6 changes: 3 additions & 3 deletions benches/comparison_kernels.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::compute::comparison::{eq, eq_scalar};
use arrow2::scalar::*;
use arrow2::util::bench_util::*;
use re_arrow2::compute::comparison::{eq, eq_scalar};
use re_arrow2::scalar::*;
use re_arrow2::util::bench_util::*;

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
2 changes: 1 addition & 1 deletion benches/concatenate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::{
use re_arrow2::{
compute::concatenate::concatenate,
util::bench_util::{create_boolean_array, create_primitive_array},
};
Expand Down
2 changes: 1 addition & 1 deletion benches/count_zeros.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::utils::count_zeros;
use re_arrow2::bitmap::utils::count_zeros;

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
12 changes: 7 additions & 5 deletions benches/filter_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
// under the License.
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::*;
use arrow2::chunk::Chunk;
use arrow2::compute::filter::{build_filter, filter, filter_chunk, Filter};
use arrow2::datatypes::DataType;
use arrow2::util::bench_util::{create_boolean_array, create_primitive_array, create_string_array};
use re_arrow2::array::*;
use re_arrow2::chunk::Chunk;
use re_arrow2::compute::filter::{build_filter, filter, filter_chunk, Filter};
use re_arrow2::datatypes::DataType;
use re_arrow2::util::bench_util::{
create_boolean_array, create_primitive_array, create_string_array,
};

fn bench_filter(data_array: &dyn Array, filter_array: &BooleanArray) {
criterion::black_box(filter(data_array, filter_array).unwrap());
Expand Down
2 changes: 1 addition & 1 deletion benches/growable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::{
use re_arrow2::{
array::growable::{Growable, GrowablePrimitive},
util::bench_util::create_primitive_array,
};
Expand Down
4 changes: 2 additions & 2 deletions benches/hash_kernel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::compute::hash::hash;
use arrow2::util::bench_util::*;
use re_arrow2::compute::hash::hash;
use re_arrow2::util::bench_util::*;

fn add_benchmark(c: &mut Criterion) {
let log2_size = 10;
Expand Down
2 changes: 1 addition & 1 deletion benches/iter_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::iter::FromIterator;

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::{
use re_arrow2::{
array::{ListArray, PrimitiveArray},
bitmap::Bitmap,
buffer::Buffer,
Expand Down
2 changes: 1 addition & 1 deletion benches/iter_utf8.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::Utf8Array;
use re_arrow2::array::Utf8Array;

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
4 changes: 2 additions & 2 deletions benches/length_kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::*;
use arrow2::compute::length::length;
use re_arrow2::array::*;
use re_arrow2::compute::length::length;

fn bench_length(array: &Utf8Array<i32>) {
criterion::black_box(length(array).unwrap());
Expand Down
6 changes: 3 additions & 3 deletions benches/like_kernels.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use arrow2::util::bench_util::create_string_array;
use criterion::{criterion_group, criterion_main, Criterion};
use re_arrow2::util::bench_util::create_string_array;

use arrow2::array::*;
use arrow2::compute::like::like_utf8_scalar;
use re_arrow2::array::*;
use re_arrow2::compute::like::like_utf8_scalar;

fn bench_like(array: &Utf8Array<i32>, pattern: &str) {
criterion::black_box(like_utf8_scalar(array, pattern).unwrap());
Expand Down
8 changes: 4 additions & 4 deletions benches/read_json.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use arrow2::array::Array;
use arrow2::datatypes::DataType;
use criterion::{criterion_group, criterion_main, Criterion};
use re_arrow2::array::Array;
use re_arrow2::datatypes::DataType;

use arrow2::io::json::{read, write};
use arrow2::util::bench_util::*;
use re_arrow2::io::json::{read, write};
use re_arrow2::util::bench_util::*;

fn prep(array: impl Array + 'static) -> (Vec<u8>, DataType) {
let mut data = vec![];
Expand Down
4 changes: 2 additions & 2 deletions benches/read_parquet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::{fs, io::Cursor, path::PathBuf};

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::error::Result;
use arrow2::io::parquet::read;
use re_arrow2::error::Result;
use re_arrow2::io::parquet::read;

fn to_buffer(
size: usize,
Expand Down
2 changes: 1 addition & 1 deletion benches/slices_iterator.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::{utils::SlicesIterator, Bitmap};
use re_arrow2::bitmap::{utils::SlicesIterator, Bitmap};

fn bench_slices(lhs: &Bitmap) {
let set_count = lhs.len() - lhs.unset_bits();
Expand Down
6 changes: 3 additions & 3 deletions benches/sort_kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::*;
use arrow2::compute::sort::{lexsort, sort, sort_to_indices, SortColumn, SortOptions};
use arrow2::util::bench_util::*;
use re_arrow2::array::*;
use re_arrow2::compute::sort::{lexsort, sort, sort_to_indices, SortColumn, SortOptions};
use re_arrow2::util::bench_util::*;

fn bench_lexsort(arr_a: &dyn Array, array_b: &dyn Array) {
let columns = vec![
Expand Down
6 changes: 3 additions & 3 deletions benches/take_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use rand::{rngs::StdRng, Rng, SeedableRng};

use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::array::*;
use arrow2::compute::take;
use arrow2::util::bench_util::*;
use re_arrow2::array::*;
use re_arrow2::compute::take;
use re_arrow2::util::bench_util::*;

fn create_random_index(size: usize, null_density: f32) -> PrimitiveArray<i32> {
let mut rng = StdRng::seed_from_u64(42);
Expand Down
2 changes: 1 addition & 1 deletion benches/unset_count.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};

use arrow2::bitmap::utils::count_zeros;
use re_arrow2::bitmap::utils::count_zeros;

fn add_benchmark(c: &mut Criterion) {
(10..=20).step_by(2).for_each(|log2_size| {
Expand Down
Loading

0 comments on commit a602463

Please sign in to comment.