Skip to content

Commit

Permalink
removing units
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhawvipul committed May 26, 2024
1 parent 8395775 commit ffacb98
Showing 1 changed file with 0 additions and 91 deletions.
91 changes: 0 additions & 91 deletions core/src/execution/datafusion/expressions/negative.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,65 +145,6 @@ impl PhysicalExpr for NegativeExpr {
}
}
}
DataType::UInt8 => {
let int_array = array
.as_any()
.downcast_ref::<arrow::array::UInt8Array>()
.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::<arrow::array::UInt16Array>()
.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::<arrow::array::UInt32Array>()
.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::<arrow::array::UInt64Array>()
.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()
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ffacb98

Please sign in to comment.