public void setWriteId(long writeId) {
    this.writeId = writeId;
    if (writeId > maxWriteId) {
      throw new IllegalStateException(String.format("Write ID is out of range (%d bits) in surrogate_key", writeIdBits));
    }
  }
This function is not a deterministic function, and not a runtime constant.
The return value is sequence within a query with a unique staring point based on write_id and task_id
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSurrogateKey.java