@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length == 0) {
      writeIdBits = DEFAULT_WRITE_ID_BITS;
      taskIdBits = DEFAULT_TASK_ID_BITS;
      rowIdBits = DEFAULT_ROW_ID_BITS;
    } else if (arguments.length == 2) {
      for (int i = 0; i < 2; i++) {
        if (arguments[i].getCategory() != Category.PRIMITIVE) {
          throw new UDFArgumentTypeException(0,
              "SURROGATE_KEY input only takes primitive types, got " + arguments[i].getTypeName());
        }
      }

      writeIdBits = ((WritableConstantIntObjectInspector)arguments[0]).getWritableConstantValue().get();
      taskIdBits = ((WritableConstantIntObjectInspector)arguments[1]).getWritableConstantValue().get();
      rowIdBits = 64 - (writeIdBits + taskIdBits);

      if (writeIdBits < 1 || writeIdBits > 62) {
        throw new UDFArgumentException("Write ID bits must be between 1 and 62 (value: " + writeIdBits + ")");
      }
      if (taskIdBits < 1 || taskIdBits > 62) {
        throw new UDFArgumentException("Task ID bits must be between 1 and 62 (value: " + taskIdBits + ")");
      }
      if (writeIdBits + taskIdBits > 63) {
        throw new UDFArgumentException("Write ID bits + Task ID bits must be less than 63 (value: " +
            (writeIdBits + taskIdBits) + ")");
      }
    } else {
      throw new UDFArgumentLengthException(
          "The function SURROGATE_KEY takes 0 or 2 integer arguments (write id bits, taks id bits), but found " +
              arguments.length);
    }

    maxWriteId = (1L << writeIdBits) - 1;
    maxTaskId = (1L << taskIdBits) - 1;
    maxRowId = (1L << rowIdBits) - 1;

    return PrimitiveObjectInspectorFactory.writableLongObjectInspector;
  }
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