pub fn try_evaluate_on_column_field(
        &self,
        columns: &DataColumnsWithField,
    ) -> Option<Result<DataColumn>> {
        if let Some((interval, date_datetime)) = self.check_interval_date_columns(columns) {
            let col = match interval.data_type() {
                DataType::Interval(IntervalUnit::YearMonth) => match date_datetime.data_type() {
                    DataType::DateTime32(_) => {
                        self.datetime_plus_minus_year_month(date_datetime, interval)
                    }
                    DataType::Date16 | DataType::Date32 => {
                        self.date_plus_minus_year_month(date_datetime, interval)
                    }
                    _ => unreachable!(),
                },
                DataType::Interval(IntervalUnit::DayTime) => match date_datetime.data_type() {
                    DataType::DateTime32(_) => {
                        self.datetime_plus_minus_day_time(date_datetime, interval)
                    }
                    DataType::Date16 | DataType::Date32 => {
                        self.date_plus_minus_day_time(date_datetime, interval)
                    }
                    _ => unreachable!(),
                },
                _ => unreachable!(),
            };
            Some(col)
        } else {
            None
        }
    }
// This is an arithmetic support for DataColumnWithField. Maybe we should move it into to "impl DataColumnWithField",
// thus we can do it like "columns[0].arithmetic(columns[1])".
// Currently only apply for Plus/Minus operation between Date/DateTime and Interval
This is an arithmetic support for DataColumnWithField. Maybe we should move it into to "impl DataColumnWithField",
thus we can do it like "columns[0].arithmetic(columns[1])".
Currently only apply for Plus/Minus operation between Date/DateTime and Interval
This is an arithmetic support for DataColumnWithField . Maybe we should move it into to " impl DataColumnWithField " thus we can do it like " columns [ 0 ] . arithmetic ( columns [ 1 ] ) " . Currently only apply for Plus / Minus operation between Date / DateTime and Interval
pub fn try_evaluate_on_column_field(
        &self,
        columns: &DataColumnsWithField,
    ) -> Option<Result<DataColumn>> {
        if let Some((interval, date_datetime)) = self.check_interval_date_columns(columns) {
            let col = match interval.data_type() {
                DataType::Interval(IntervalUnit::YearMonth) => match date_datetime.data_type() {
                    DataType::DateTime32(_) => {
                        self.datetime_plus_minus_year_month(date_datetime, interval)
                    }
                    DataType::Date16 | DataType::Date32 => {
                        self.date_plus_minus_year_month(date_datetime, interval)
                    }
                    _ => unreachable!(),
                },
                DataType::Interval(IntervalUnit::DayTime) => match date_datetime.data_type() {
                    DataType::DateTime32(_) => {
                        self.datetime_plus_minus_day_time(date_datetime, interval)
                    }
                    DataType::Date16 | DataType::Date32 => {
                        self.date_plus_minus_day_time(date_datetime, interval)
                    }
                    _ => unreachable!(),
                },
                _ => unreachable!(),
            };
            Some(col)
        } else {
            None
        }
    }
pub fn try_evaluate_on_column_field ( & self , columns : & DataColumnsWithField , ) -> Option < Result < DataColumn > > { if let Some ( ( interval , date_datetime ) ) = self . check_interval_date_columns ( columns ) { let col = match interval . data_type ( ) { DataType :: Interval ( IntervalUnit :: YearMonth ) => match date_datetime . data_type ( ) { DataType :: DateTime32 ( _ ) => { self . datetime_plus_minus_year_month ( date_datetime , interval ) } DataType :: Date16 | DataType :: Date32 => { self . date_plus_minus_year_month ( date_datetime , interval ) } _ => unreachable ! ( ) , } , DataType :: Interval ( IntervalUnit :: DayTime ) => match date_datetime . data_type ( ) { DataType :: DateTime32 ( _ ) => { self . datetime_plus_minus_day_time ( date_datetime , interval ) } DataType :: Date16 | DataType :: Date32 => { self . date_plus_minus_day_time ( date_datetime , interval ) } _ => unreachable ! ( ) , } , _ => unreachable ! ( ) , } ; Some ( col ) } else { None } }
This is an arithmetic support for DataColumnWithField.
This is an arithmetic support for DataColumnWithField .
&self
columns
&DataColumnsWithField
&self
columns
&DataColumnsWithField