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

Method MurmurHashDecimal

be/src/exprs/utility-functions-ir.cc:116–124  ·  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

114// Note that this only hashes the unscaled value and not the scale or precision, so this
115// function is only valid when used over a single decimal type.
116BigIntVal UtilityFunctions::MurmurHashDecimal(FunctionContext* ctx,
117 const DecimalVal& input_val) {
118 if (input_val.is_null) return BigIntVal::null();
119 const FunctionContext::TypeDesc& input_type = *ctx->GetArgType(0);
120 int byte_size = ColumnType::GetDecimalByteSize(input_type.precision);
121 // val4, val8 and val16 all start at the same memory address.
122 return BigIntVal(HashUtil::MurmurHash2_64(&input_val.val16, byte_size,
123 HashUtil::MURMUR_DEFAULT_SEED));
124}
125
126template BigIntVal UtilityFunctions::MurmurHash(
127 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