presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/organization/TemporalFunction.java/TemporalFunction/getDayFromRange
class TemporalFunction:    public int getDayFromRange(ShardRange range)
    {
        Tuple min = range.getMinTuple();
        Tuple max = range.getMaxTuple();
        checkArgument(getOnlyElement(min.getTypes()).equals(getOnlyElement(max.getTypes())), "type of min and max is not same");

        Type type = getOnlyElement(min.getTypes());
        if (type.equals(DATE)) {
            return (int) getOnlyElement(min.getValues());
        }

        if (type.equals(TIMESTAMP)) {
            long minValue = timeZone.convertUTCToLocal((long) getOnlyElement(min.getValues()));
            long maxValue = timeZone.convertUTCToLocal((long) getOnlyElement(max.getValues()));
            return determineDay(minValue, maxValue);
        }

        throw new IllegalArgumentException("Wrong type for shard range: " + type);
    }