Skip to content

Commit

Permalink
Replace get_field_type with field.ty()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse-Bakker committed Sep 20, 2023
1 parent 81f28e7 commit 9f4dbed
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions dozer-sql/expression/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl Expression {
pub fn get_type(&self, schema: &Schema) -> Result<ExpressionType, Error> {
match self {
Expression::Literal(field) => {
let field_type = get_field_type(field);
let field_type = field.ty();
match field_type {
Some(f) => Ok(ExpressionType::new(
f,
Expand Down Expand Up @@ -472,27 +472,6 @@ impl Expression {
}
}

pub fn get_field_type(field: &Field) -> Option<FieldType> {
match field {
Field::UInt(_) => Some(FieldType::UInt),
Field::U128(_) => Some(FieldType::U128),
Field::Int(_) => Some(FieldType::Int),
Field::I128(_) => Some(FieldType::I128),
Field::Float(_) => Some(FieldType::Float),
Field::Boolean(_) => Some(FieldType::Boolean),
Field::String(_) => Some(FieldType::String),
Field::Binary(_) => Some(FieldType::Binary),
Field::Decimal(_) => Some(FieldType::Decimal),
Field::Timestamp(_) => Some(FieldType::Timestamp),
Field::Json(_) => Some(FieldType::Json),
Field::Text(_) => Some(FieldType::Text),
Field::Date(_) => Some(FieldType::Date),
Field::Point(_) => Some(FieldType::Point),
Field::Duration(_) => Some(FieldType::Duration),
Field::Null => None,
}
}

fn get_unary_operator_type(
operator: &UnaryOperatorType,
expression: &Expression,
Expand Down

0 comments on commit 9f4dbed

Please sign in to comment.