Note that this only hashes the unscaled value and not the scale or precision, so this function is only valid when used over a single decimal type.
| 64 | // Note that this only hashes the unscaled value and not the scale or precision, so this |
| 65 | // function is only valid when used over a single decimal type. |
| 66 | BigIntVal UtilityFunctions::FnvHashDecimal(FunctionContext* ctx, |
| 67 | const DecimalVal& input_val) { |
| 68 | if (input_val.is_null) return BigIntVal::null(); |
| 69 | const FunctionContext::TypeDesc& input_type = *ctx->GetArgType(0); |
| 70 | int byte_size = ColumnType::GetDecimalByteSize(input_type.precision); |
| 71 | // val4, val8 and val16 all start at the same memory address. |
| 72 | return BigIntVal(HashUtil::FnvHash64(&input_val.val16, byte_size, HashUtil::FNV_SEED)); |
| 73 | } |
| 74 | |
| 75 | template BigIntVal UtilityFunctions::FnvHash( |
| 76 | FunctionContext* ctx, const BooleanVal& input_val); |
nothing calls this directly
no test coverage detected