private static int getSlotValue(Field field) {
    try {
      var lookup = MethodHandles.privateLookupIn(Field.class, MethodHandles.lookup());
      VarHandle slotHandle = lookup.findVarHandle(Field.class, "slot", int.class);
      return (int) slotHandle.get(field);
    } catch (NoSuchFieldException | IllegalAccessException | IllegalArgumentException e) {
      LOG.error("Error getting a slot value:", e);
      throw new RuntimeException("Error getting a slot value");
    }
  }
Returns slot value used for ordering the fields to make it deterministic
@param field : field of a given class
@return int slot
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java