in cpp-ch/local-engine/Functions/SparkFunctionHashingExtended.h [393:470]
void executeAny(const DB::IDataType * from_type, const DB::IColumn * column, typename DB::ColumnVector<ToType>::Container & vec_to) const
{
if (column->size() != vec_to.size())
throw DB::Exception(DB::ErrorCodes::LOGICAL_ERROR, "Argument column '{}' size {} doesn't match result column size {} of function {}",
column->getName(), column->size(), vec_to.size(), getName());
const DB::NullMap * null_map = nullptr;
const DB::IColumn * data_column = column;
bool from_const = false;
if (isColumnConst(*column))
{
from_const = true;
data_column = &assert_cast<const DB::ColumnConst &>(*column).getDataColumn();
}
if (const DB::ColumnNullable * col_nullable = checkAndGetColumn<DB::ColumnNullable>(data_column))
{
null_map = &col_nullable->getNullMapData();
data_column = &col_nullable->getNestedColumn();
}
DB::WhichDataType which(removeNullable(from_type->shared_from_this()));
/// Skip column with type Nullable(Nothing)
if (which.isNothing())
;
else if (which.isUInt8())
executeNumberType<UInt8>(from_const, data_column, null_map, vec_to);
else if (which.isUInt16())
executeNumberType<UInt16>(from_const, data_column, null_map, vec_to);
else if (which.isUInt32())
executeNumberType<UInt32>(from_const, data_column, null_map, vec_to);
else if (which.isUInt64())
executeNumberType<UInt64>(from_const, data_column, null_map, vec_to);
else if (which.isInt8())
executeNumberType<Int8>(from_const, data_column, null_map, vec_to);
else if (which.isInt16())
executeNumberType<Int16>(from_const, data_column, null_map, vec_to);
else if (which.isInt32())
executeNumberType<Int32>(from_const, data_column, null_map, vec_to);
else if (which.isInt64())
executeNumberType<Int64>(from_const, data_column, null_map, vec_to);
else if (which.isFloat32())
executeNumberType<Float32>(from_const, data_column, null_map, vec_to);
else if (which.isFloat64())
executeNumberType<Float64>(from_const, data_column, null_map, vec_to);
else if (which.isDate())
executeNumberType<UInt16>(from_const, data_column, null_map, vec_to);
else if (which.isDate32())
executeNumberType<Int32>(from_const, data_column, null_map, vec_to);
else if (which.isDateTime())
executeNumberType<UInt32>(from_const, data_column, null_map, vec_to);
else if (which.isDateTime64())
executeNumberType<DB::DateTime64>(from_const, data_column, null_map, vec_to);
else if (which.isDecimal32())
executeNumberType<DB::Decimal32>(from_const, data_column, null_map, vec_to);
else if (which.isDecimal64())
executeNumberType<DB::Decimal64>(from_const, data_column, null_map, vec_to);
else if (which.isDecimal128())
executeNumberType<DB::Decimal128>(from_const, data_column, null_map, vec_to);
else if (which.isString())
executeString(from_const, data_column, null_map, vec_to);
else if (which.isFixedString())
executeFixedString(from_const, data_column, null_map, vec_to);
else if (which.isArray())
executeGeneric(from_type, from_const, data_column, null_map, vec_to);
else if (which.isTuple())
executeGeneric(from_type, from_const, data_column, null_map, vec_to);
else
{
/// Note: No need to implement for big int type in gluten
/// Note: No need to implement for uuid/ipv4/ipv6/enum* type in gluten
/// Note: No need to implement for decimal256 type in gluten
/// Note: No need to implement for map type as long as spark.sql.legacy.allowHashOnMapType is false(default)
throw DB::Exception(DB::ErrorCodes::NOT_IMPLEMENTED, "Function {} hasn't supported type {}", getName(), from_type->getName());
}
}