Skip to content

Commit

Permalink
update arrow2
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 21, 2021
1 parent 2124095 commit 2f0ddef
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
5 changes: 2 additions & 3 deletions polars/polars-arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ description = "Arrow interfaces for Polars DataFrame library"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "f326fed4f3f7b428deee0d4adb46eebc8b7a3471", default-features = false }
#arrow = { package = "arrow2", git = "https://github.com/ritchie46/arrow2", rev = "8aab4065eedfdee458ceb315b65e23cc8e9f06f5", default-features = false, features=["io_parquet_compression"] }
arrow = { package = "arrow2", version = "0.5.3", default-features=false}
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "fa5d9eaead7eddce65624e67baabf75c975fb9bd", default-features = false }
#arrow = { package = "arrow2", version = "0.5.3", default-features=false}
thiserror = "^1.0"
num = "^0.4"
5 changes: 2 additions & 3 deletions polars/polars-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ docs-selection = [
]

[dependencies]
#arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "f326fed4f3f7b428deee0d4adb46eebc8b7a3471", default-features = false, features=["compute"]}
#arrow = { package = "arrow2", git = "https://github.com/ritchie46/arrow2", rev = "8aab4065eedfdee458ceb315b65e23cc8e9f06f5", default-features = false, features=["compute"] }
arrow = { package = "arrow2", version="0.5.3", default-features = false, features=["compute"]}
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "fa5d9eaead7eddce65624e67baabf75c975fb9bd", default-features = false, features=["compute"] }
#arrow = { package = "arrow2", version="0.5.3", default-features = false, features=["compute"]}
polars-arrow = {version = "0.16.0", path = "../polars-arrow"}
thiserror = "1.0"
num = "^0.4"
Expand Down
23 changes: 19 additions & 4 deletions polars/polars-core/src/chunked_array/comparison.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::utils::align_chunks_binary;
use crate::{prelude::*, utils::NoNull};
use arrow::compute::comparison::Simd8;
use arrow::scalar::Utf8Scalar;
use arrow::types::NativeType;
use arrow::{
array::{ArrayRef, BooleanArray, PrimitiveArray, Utf8Array},
compute,
Expand Down Expand Up @@ -455,15 +457,22 @@ impl NumComp for u64 {}
impl<T> ChunkedArray<T>
where
T: PolarsNumericType,
T::Native: NumCast + NumComp + Simd8,
T::Native: NumCast + NumComp + Simd8 + NativeType,
{
fn primitive_compare_scalar<Rhs: NumComp + ToPrimitive>(
&self,
rhs: Rhs,
op: comparison::Operator,
) -> BooleanChunked {
let rhs = NumCast::from(rhs).expect("could not cast to underlying chunkedarray type");
self.apply_kernel_cast(|arr| Arc::new(comparison::primitive_compare_scalar(arr, rhs, op)))
let rhs: T::Native =
NumCast::from(rhs).expect("could not cast to underlying chunkedarray type");
self.apply_kernel_cast(|arr| {
Arc::new(comparison::primitive_compare_scalar(
arr,
&Some(rhs).into(),
op,
))
})
}
}

Expand Down Expand Up @@ -504,7 +513,13 @@ where

impl Utf8Chunked {
fn utf8_compare_scalar(&self, rhs: &str, op: comparison::Operator) -> BooleanChunked {
self.apply_kernel_cast(|arr| Arc::new(comparison::utf8_compare_scalar(arr, rhs, op)))
self.apply_kernel_cast(|arr| {
Arc::new(comparison::utf8_compare_scalar(
arr,
&Utf8Scalar::<i64>::new(Some(rhs)),
op,
))
})
}
}

Expand Down
7 changes: 3 additions & 4 deletions polars/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parquet = ["polars-core/parquet", "arrow/io_parquet", "arrow/io_parquet_compress
dtype-u64 = ["polars-core/dtype-u64"]
dtype-date64 = ["polars-core/dtype-date64", "polars-core/temporal"]
dtype-date32 = ["polars-core/dtype-date32"]
csv-file = ["csv-core", "memmap", "lexical", "arrow/io_csv"]
csv-file = ["csv-core", "memmap", "lexical", "arrow/io_csv_write"]
fmt = ["polars-core/plain_fmt"]
decompress = ["flate2/miniz_oxide"]
decompress-fast = ["flate2/zlib-ng-compat"]
Expand All @@ -29,9 +29,8 @@ temporal = ["polars-core/dtype-date32", "polars-core/dtype-date64"]
private = []

[dependencies]
#arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "f326fed4f3f7b428deee0d4adb46eebc8b7a3471", --default-features=false }
#arrow = { package = "arrow2", git = "https://github.com/ritchie46/arrow2", rev = "8aab4065eedfdee458ceb315b65e23cc8e9f06f5", default-features = false }
arrow = { package = "arrow2", version="0.5.3", --default-features=false }
arrow = { package = "arrow2", git = "https://github.com/jorgecarleitao/arrow2", rev = "fa5d9eaead7eddce65624e67baabf75c975fb9bd", default-features = false }
#arrow = { package = "arrow2", version="0.5.3", --default-features=false }
polars-core = {version = "0.16.0", path = "../polars-core", features = ["private"], default-features=false}
polars-arrow = {version = "0.16.0", path = "../polars-arrow"}
lexical = {version = "6", optional = true}
Expand Down
17 changes: 11 additions & 6 deletions py-polars/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2f0ddef

Please sign in to comment.