You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: range.rs
    path of file: ./repos/databend/src/query/service/src/table_functions/srf
    
    the code of the file until where you have to start completion: // Copyright 2021 Datafuse Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::any::Any;
use std::mem::discriminant;
use std::sync::Arc;

use chrono::NaiveDateTime;
use chrono::TimeZone;
use chrono::Utc;
use databend_common_catalog::plan::DataSourcePlan;
use databend
    
fn validate_args(args: &Vec<Scalar>, table_func_name: &str) -> Result<()> {
    // Check args len.
    validate_function_arg(table_func_name, args.len(), Some((2, 3)), 2)?;

    // Check whether the data types of start and end are consistent.
    if discriminant(&args[0]) != discriminant(&args[1]) {
        return Err(ErrorCode::BadDataValueType(format!(
            "Expected same scalar type, but got start is {:?} and end is {:?}",
            args[0], args[1]
        )));
    }

    if args.iter().all(|arg| {
        matches!(
            arg,
            Scalar::Number(_) | Scalar::Date(_) | Scalar::Timestamp(_)
        )
    }) {
        Ok(())
    } else {
        Err(ErrorCode::BadDataValueType(format!(
            "Expected Number, Date or Timestamp type, but got {:?}",
            args
        )))
    }
}