From ffacb98bf39bcc0213160b0709c49f1988358f50 Mon Sep 17 00:00:00 2001 From: Vipul Vaibhaw Date: Sun, 26 May 2024 22:43:08 +0530 Subject: [PATCH] removing units --- .../datafusion/expressions/negative.rs | 91 ------------------- 1 file changed, 91 deletions(-) diff --git a/core/src/execution/datafusion/expressions/negative.rs b/core/src/execution/datafusion/expressions/negative.rs index ec5abfefb..dd6b96603 100644 --- a/core/src/execution/datafusion/expressions/negative.rs +++ b/core/src/execution/datafusion/expressions/negative.rs @@ -145,65 +145,6 @@ impl PhysicalExpr for NegativeExpr { } } } - DataType::UInt8 => { - let int_array = array - .as_any() - .downcast_ref::() - .unwrap(); - for i in 0..int_array.len() { - if int_array.value(i) <= u8::MIN || int_array.value(i) >= u8::MAX { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - } - DataType::UInt16 => { - let int_array = array - .as_any() - .downcast_ref::() - .unwrap(); - for i in 0..int_array.len() { - if int_array.value(i) <= u16::MIN || int_array.value(i) >= u16::MAX - { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - } - DataType::UInt32 => { - let int_array = array - .as_any() - .downcast_ref::() - .unwrap(); - for i in 0..int_array.len() { - if int_array.value(i) <= u32::MIN || int_array.value(i) >= u32::MAX - { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - } - DataType::UInt64 => { - let int_array = array - .as_any() - .downcast_ref::() - .unwrap(); - for i in 0..int_array.len() { - if int_array.value(i) <= u64::MIN || int_array.value(i) >= u64::MAX - { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - } DataType::Float16 => { let float_array = array .as_any() @@ -351,38 +292,6 @@ impl PhysicalExpr for NegativeExpr { .into()); } } - ScalarValue::UInt8(value) => { - if value <= Some(u8::MIN) || value >= Some(u8::MAX) { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - ScalarValue::UInt16(value) => { - if value <= Some(u16::MIN) || value >= Some(u16::MAX) { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - ScalarValue::UInt32(value) => { - if value <= Some(u32::MIN) || value >= Some(u32::MAX) { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } - ScalarValue::UInt64(value) => { - if value <= Some(u64::MIN) || value >= Some(u64::MAX) { - return Err(CometError::ArithmeticOverflow { - from_type: "integer".to_string(), - } - .into()); - } - } ScalarValue::Float32(value) => { if value <= Some(f32::MIN) || value >= Some(f32::MAX) { return Err(CometError::ArithmeticOverflow {