public static Object convertPartitionLiteral(Object literal, TransformSpec transform) {
    if (transform == null) {
      return literal;
    }
    try {
      switch (transform.getTransformType()) {
        case YEAR:
          return parseYearToTransformYear(literal.toString());
        case MONTH:
          return parseMonthToTransformMonth(literal.toString());
        case HOUR:
          return parseHourToTransformHour(literal.toString());
        case DAY:
        case TRUNCATE:
        case BUCKET:
        case IDENTITY:
          return literal;
        default:
          throw new UnsupportedOperationException("Unknown transform: " + transform.getTransformType());
      }
    } catch (NumberFormatException | DateTimeException | IllegalStateException e) {
      throw new RuntimeException(
          String.format("Unable to parse value '%s' as '%s' transform value", literal.toString(), transform));
    }
  }
Translate leaf nodes from Hive operator to Iceberg operator.
@param leaf Leaf node
@return Expression fully translated from Hive PredicateLeaf
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java