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

Commit

Permalink
Avoid importing Array (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao authored Dec 21, 2021
1 parent 4e19144 commit e4dc0b8
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/csv_write_parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Arc;
use std::thread;

use arrow2::{
array::{Array, Int32Array},
array::Int32Array,
datatypes::{Field, Schema},
error::Result,
io::csv::write,
Expand Down
2 changes: 1 addition & 1 deletion examples/parquet_write_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fs::File;
use std::sync::Arc;

use arrow2::{
array::{Array, Int32Array},
array::Int32Array,
datatypes::{Field, Schema},
error::Result,
io::parquet::write::{
Expand Down
5 changes: 1 addition & 4 deletions src/array/equal/primitive.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::{
array::{Array, PrimitiveArray},
types::NativeType,
};
use crate::{array::PrimitiveArray, types::NativeType};

pub(super) fn equal<T: NativeType>(lhs: &PrimitiveArray<T>, rhs: &PrimitiveArray<T>) -> bool {
lhs.data_type() == rhs.data_type() && lhs.len() == rhs.len() && lhs.iter().eq(rhs.iter())
Expand Down
3 changes: 2 additions & 1 deletion src/array/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ impl<T: NativeType> PrimitiveArray<T> {
self.validity.as_ref()
}

/// The arrays' logical type
#[inline]
fn data_type(&self) -> &DataType {
pub fn data_type(&self) -> &DataType {
&self.data_type
}

Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/basic/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::ops::Add;
use num_traits::{ops::overflowing::OverflowingAdd, CheckedAdd, SaturatingAdd, WrappingAdd};

use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
bitmap::Bitmap,
compute::{
arithmetics::{
Expand Down
5 changes: 1 addition & 4 deletions src/compute/arithmetics/basic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ use std::ops::Neg;

use num_traits::{CheckedNeg, WrappingNeg};

use crate::{
array::{Array, PrimitiveArray},
types::NativeType,
};
use crate::{array::PrimitiveArray, types::NativeType};

use super::super::arity::{unary, unary_checked};

Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/basic/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::ops::Mul;
use num_traits::{ops::overflowing::OverflowingMul, CheckedMul, SaturatingMul, WrappingMul};

use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
bitmap::Bitmap,
compute::{
arithmetics::{
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/basic/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use num_traits::{checked_pow, CheckedMul, One, Pow};

use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
compute::arity::{unary, unary_checked},
};

Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/basic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::ops::Sub;
use num_traits::{ops::overflowing::OverflowingSub, CheckedSub, SaturatingSub, WrappingSub};

use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
bitmap::Bitmap,
compute::{
arithmetics::{
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/decimal/add.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Defines the addition arithmetic kernels for [`PrimitiveArray`] representing decimals.
use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
buffer::Buffer,
compute::{
arithmetics::{ArrayAdd, ArrayCheckedAdd, ArraySaturatingAdd},
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/decimal/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! `PrimitiveArrays`.
use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
buffer::Buffer,
compute::{
arithmetics::{ArrayCheckedDiv, ArrayDiv},
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/decimal/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! `PrimitiveArrays`.
use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
buffer::Buffer,
compute::{
arithmetics::{ArrayCheckedMul, ArrayMul, ArraySaturatingMul},
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/decimal/sub.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Defines the subtract arithmetic kernels for Decimal `PrimitiveArrays`.
use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
buffer::Buffer,
compute::{
arithmetics::{ArrayCheckedSub, ArraySaturatingSub, ArraySub},
Expand Down
2 changes: 1 addition & 1 deletion src/compute/arithmetics/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::ops::{Add, Sub};
use num_traits::AsPrimitive;

use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
compute::arity::{binary, unary},
datatypes::{DataType, TimeUnit},
error::{ArrowError, Result},
Expand Down
2 changes: 1 addition & 1 deletion src/compute/bitwise.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains bitwise operators: [`or`], [`and`], [`xor`] and [`not`].
use std::ops::{BitAnd, BitOr, BitXor, Not};

use crate::array::{Array, PrimitiveArray};
use crate::array::PrimitiveArray;
use crate::compute::arity::{binary, unary};
use crate::types::NativeType;

Expand Down
2 changes: 1 addition & 1 deletion src/compute/sort/primitive/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use crate::bitmap::Bitmap;
use crate::buffer::{Buffer, MutableBuffer};
use crate::{
array::{Array, PrimitiveArray},
array::PrimitiveArray,
bitmap::{utils::SlicesIterator, MutableBitmap},
types::NativeType,
};
Expand Down

0 comments on commit e4dc0b8

Please sign in to comment.