MCPcopy Create free account
hub / github.com/apache/impala / FnvHashDecimal

Method FnvHashDecimal

be/src/exprs/utility-functions-ir.cc:66–73  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
66BigIntVal 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
75template BigIntVal UtilityFunctions::FnvHash(
76 FunctionContext* ctx, const BooleanVal& input_val);

Callers

nothing calls this directly

Calls 2

BigIntValClass · 0.85
GetArgTypeMethod · 0.80

Tested by

no test coverage detected