Anyone has source code of some dremio sql functions (for eample hash, hash64)?

Does anyone have the source code of the below SQL function hash/hash64

Need to make sure there is no Uniqueness/Collision after hashing value.

Try to find in the dremio-oss GitHub project, but no luck so far

you can find code in Hash64Functions dremio-oss/sabot/kernel/src/main/java/com/dremio/exec/expr/fn/impl/Hash64Functions.java at master · dremio/dremio-oss · GitHub

that use Murmur algorithms

1 Like

There is this part

@Override
public void eval() {
  out.isSet = 1;
  if (in.isSet == 0) {
    out.value = 0;
  } else {
    out.value = com.dremio.common.expression.fn.impl.HashHelper.hash64(in.value, 0);
  }
}

Which call

com.dremio.common.expression.fn.impl.HashHelper.hash64

Which I think is the main logic of the function. But I can’t find it anywhere in the code?
There is no main logic in the

Nvm I found it

It uses the MurmurHash3, which logic stores in this file

I think hash64 is safe for collision at < 1 billion items