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: utils.rs
    path of file: ./repos/databend/src/query/expression/src/kernels/group_by_hash
    
    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 ethnum::i256;

use crate::kernels::utils::copy_advance_aligned;
use crate::kernels::utils::set_vec_len_by_ptr;
use crate::kernels::utils::store_advance;
use crate::kernels::utils::store_advance_aligned;
use crate::types::binary::BinaryColumn;
use crate::types::decimal::DecimalColumn;
use crate::types::NumberColumn;
use crate::with_decimal_mapped_type;
use crate::with_number_mapped_type;
use crate::Column;

/// The serialize_size is equal to the number of bytes required by serialization.
pub fn serialize_group_columns(
    columns: &[Column],
    num_rows: usize,
    serialize_size: usize,
) -> BinaryColumn {
    // [`BinaryColumn`] consists of [`data`] and [`offset`], we build [`data`] and [`offset`] respectively,
    // and then call `BinaryColumn::new(data.into(), offsets.into())` to create [`BinaryColumn`].
    let
    
pub unsafe fn serialize_column_binary(column: &Column, row: usize, row_space: &mut *mut u8) {
    match column {
        Column::Null { .. } | Column::EmptyArray { .. } | Column::EmptyMap { .. } => {}
        Column::Number(v) => with_number_mapped_type!(|NUM_TYPE| match v {
            NumberColumn::NUM_TYPE(v) => {
                store_advance::<NUM_TYPE>(&v[row], row_space);
            }
        }),
        Column::Decimal(v) => {
            with_decimal_mapped_type!(|DECIMAL_TYPE| match v {
                DecimalColumn::DECIMAL_TYPE(v, _) => {
                    store_advance::<DECIMAL_TYPE>(&v[row], row_space);
                }
            })
        }
        Column::Boolean(v) => store_advance::<bool>(&v.get_bit(row), row_space),
        Column::Binary(v) | Column::Bitmap(v) | Column::Variant(v) | Column::Geometry(v) => {
            let value = unsafe { v.index_unchecked(row) };
            let len = value.len();
            store_advance::<u64>(&(len as u64), row_space);
            copy_advance_aligned::<u8>(value.as_ptr(), row_space, len);
        }
        Column::String(v) => {
            let value = unsafe { v.index_unchecked(row) };
            let len = value.len();
            store_advance::<u64>(&(len as u64), row_space);
            copy_advance_aligned::<u8>(value.as_ptr(), row_space, len);
        }
        Column::Timestamp(v) => store_advance::<i64>(&v[row], row_space),
        Column::Date(v) => store_advance::<i32>(&v[row], row_space),
        Column::Array(array) | Column::Map(array) => {
            let data = array.index(row).unwrap();
            store_advance::<u64>(&(data.len() as u64), row_space);
            for i in 0..data.len() {
                serialize_column_binary(&data, i, row_space);
            }
        }
        Column::Nullable(c) => {
            let valid = c.validity.get_bit(row);
            store_advance::<bool>(&valid, row_space);
            if valid {
                serialize_column_binary(&c.column, row, row_space);
            }
        }
        Column::Tuple(fields) => {
            for inner_col in fields.iter() {
                serialize_column_binary(inner_col, row, row_space);
            }
        }
    }
}