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: schema.rs
    path of file: ./repos/dozer/dozer-sink-clickhouse/src
    
    the code of the file until where you have to start completion: use crate::client::ClickhouseClient;
use crate::errors::ClickhouseSinkError::{self, SinkTableDoesNotExist};
use crate::types::DECIMAL_SCALE;
use clickhouse_rs::types::Complex;
use clickhouse_rs::{Block, ClientHandle};
use dozer_types::log::warn;
use dozer_types::models::sink::ClickhouseSinkConfig;
use dozer_types::serde::{Deserialize, Serialize}
    
pub fn map_field_to_type(field: &FieldDefinition) -> String {
    let decimal = format!("Decimal(10, {})", DECIMAL_SCALE);
    let typ: &str = match field.typ {
        FieldType::UInt => "UInt64",
        FieldType::U128 => "UInt128",
        FieldType::Int => "Int64",
        FieldType::I128 => "Int128",
        FieldType::Float => "Float64",
        FieldType::Boolean => "Boolean",
        FieldType::String => "String",
        FieldType::Text => "String",
        FieldType::Binary => "Array(UInt8)",
        FieldType::Decimal => &decimal,
        FieldType::Timestamp => "DateTime64(3)",
        FieldType::Date => "Date",
        FieldType::Json => "JSON",
        FieldType::Point => "Point",
        FieldType::Duration => unimplemented!(),
    };

    if field.nullable {
        if field.typ != FieldType::Binary {
            format!("Nullable({})", typ)
        } else {
            warn!("Binary field cannot be nullable, ignoring nullable flag");
            typ.to_string()
        }
    } else {
        typ.to_string()
    }
}