Skip to content

Commit

Permalink
clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jul 12, 2024
1 parent af07224 commit 6d1e697
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions native/Cargo.lock

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

1 change: 1 addition & 0 deletions native/spark-expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ chrono = { workspace = true }
datafusion = { workspace = true }
datafusion-common = { workspace = true }
datafusion-functions = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-physical-expr = { workspace = true }
datafusion-comet-utils = { workspace = true }
num = { workspace = true }
Expand Down
26 changes: 15 additions & 11 deletions native/spark-expr/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ use std::{
sync::Arc,
};

use super::EvalMode;
use crate::{SparkError, SparkResult};
use arrow::{
array::{
cast::AsArray,
types::{Date32Type, Int16Type, Int32Type, Int8Type},
Array, ArrayRef, BooleanArray, Decimal128Array, Float32Array, Float64Array,
GenericStringArray, Int16Array, Int32Array, Int64Array, Int8Array, OffsetSizeTrait,
PrimitiveArray,
},
compute::{cast_with_options, unary, CastOptions},
datatypes::{
ArrowPrimitiveType, Decimal128Type, DecimalType, Float32Type, Float64Type, Int64Type,
Expand All @@ -35,26 +40,25 @@ use arrow::{
record_batch::RecordBatch,
util::display::FormatOptions,
};
use arrow_array::{
cast::AsArray,
types::{Date32Type, Int16Type, Int32Type, Int8Type},
Array, ArrayRef, BooleanArray, Decimal128Array, Float32Array, Float64Array, GenericStringArray,
Int16Array, Int32Array, Int64Array, Int8Array, OffsetSizeTrait, PrimitiveArray,
};
use arrow_schema::{DataType, Schema};
use chrono::{NaiveDate, NaiveDateTime, TimeZone, Timelike};
use datafusion::logical_expr::ColumnarValue;
use datafusion_comet_utils::{array_with_timezone, down_cast_any_ref};

use datafusion_common::{
cast::as_generic_string_array, internal_err, Result as DataFusionResult, ScalarValue,
};
use datafusion_expr::ColumnarValue;
use datafusion_physical_expr::PhysicalExpr;

use chrono::{NaiveDate, NaiveDateTime, TimeZone, Timelike};
use num::{
cast::AsPrimitive, integer::div_floor, traits::CheckedNeg, CheckedSub, Integer, Num,
ToPrimitive,
};
use regex::Regex;

use datafusion_comet_utils::{array_with_timezone, down_cast_any_ref};

use crate::{EvalMode, SparkError, SparkResult};

static TIMESTAMP_FORMAT: Option<&str> = Some("%Y-%m-%d %H:%M:%S%.f");

const MICROS_PER_SECOND: i64 = 1000000;
Expand Down

0 comments on commit 6d1e697

Please sign in to comment.