diff --git a/Cargo.lock b/Cargo.lock index 84ddbbf1d..69d8dc51e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,6 +849,7 @@ version = "0.3.2-alpha.7" dependencies = [ "anyhow", "arrow", + "arrow2", "bb8", "bb8-tiberius", "chrono", diff --git a/connectorx/Cargo.toml b/connectorx/Cargo.toml index f02393f55..fa5e26f9b 100644 --- a/connectorx/Cargo.toml +++ b/connectorx/Cargo.toml @@ -23,6 +23,7 @@ serde_json = "1" chrono = "0.4" arrow = {version = "26", optional = true, features = ["prettyprint", "ffi"]} +arrow2 = {version = "0.17.3", default-features = false, optional = true} bb8 = {version = "0.7", optional = true} bb8-tiberius = {version = "0.5", optional = true} csv = {version = "1", optional = true} @@ -72,7 +73,7 @@ all = ["src_sqlite", "src_postgres", "src_mysql", "src_mssql", "src_oracle", "sr branch = [] default = ["fptr"] dst_arrow = ["arrow"] -dst_arrow2 = ["polars"] +dst_arrow2 = ["polars", "arrow2"] fptr = [] src_bigquery = ["gcp-bigquery-client", "tokio"] src_csv = ["csv", "regex"] diff --git a/connectorx/src/destinations/arrow2/arrow_assoc.rs b/connectorx/src/destinations/arrow2/arrow_assoc.rs index 3a75d4582..776af84f7 100644 --- a/connectorx/src/destinations/arrow2/arrow_assoc.rs +++ b/connectorx/src/destinations/arrow2/arrow_assoc.rs @@ -1,5 +1,5 @@ -use polars::export::arrow::array::*; -use polars::export::arrow::datatypes::{DataType as ArrowDataType, Field, TimeUnit}; +use arrow2::array::*; +use arrow2::datatypes::{DataType as ArrowDataType, Field, TimeUnit}; use chrono::{Date, DateTime, NaiveDate, NaiveDateTime, NaiveTime, Timelike, Utc}; diff --git a/connectorx/src/destinations/arrow2/errors.rs b/connectorx/src/destinations/arrow2/errors.rs index f1dca4909..f9856b7e9 100644 --- a/connectorx/src/destinations/arrow2/errors.rs +++ b/connectorx/src/destinations/arrow2/errors.rs @@ -5,7 +5,7 @@ pub type Result = std::result::Result; #[derive(Error, Debug)] pub enum Arrow2DestinationError { #[error(transparent)] - ArrowError(#[from] polars::export::arrow::error::Error), + ArrowError(#[from] arrow2::error::Error), #[error(transparent)] PolarsError(#[from] polars::error::PolarsError), diff --git a/connectorx/src/destinations/arrow2/funcs.rs b/connectorx/src/destinations/arrow2/funcs.rs index b7bbbb249..0d276af47 100644 --- a/connectorx/src/destinations/arrow2/funcs.rs +++ b/connectorx/src/destinations/arrow2/funcs.rs @@ -3,9 +3,9 @@ use super::Builder; use crate::errors::Result; use crate::typesystem::{ParameterizedFunc, ParameterizedOn}; use anyhow::anyhow; -use polars::export::arrow::datatypes::Field; +use arrow2::datatypes::Field; use std::sync::Arc; -use polars::export::arrow::array::{Array, MutableArray}; +use arrow2::array::{Array, MutableArray}; pub struct FNewBuilder; diff --git a/connectorx/src/destinations/arrow2/mod.rs b/connectorx/src/destinations/arrow2/mod.rs index 559627b7a..538a6326c 100644 --- a/connectorx/src/destinations/arrow2/mod.rs +++ b/connectorx/src/destinations/arrow2/mod.rs @@ -10,9 +10,9 @@ use crate::constants::RECORD_BATCH_SIZE; use crate::data_order::DataOrder; use crate::typesystem::{Realize, TypeAssoc, TypeSystem}; use anyhow::anyhow; -use polars::export::arrow::array::{Array, MutableArray}; -use polars::export::arrow::chunk::Chunk; -use polars::export::arrow::datatypes::{Schema, Field}; +use arrow2::array::{Array, MutableArray}; +use arrow2::chunk::Chunk; +use arrow2::datatypes::{Schema, Field}; use arrow_assoc::ArrowAssoc; pub use errors::{Arrow2DestinationError, Result}; use fehler::throw;