### Description

A query like `any where true | head 2147483648` fails with `class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')`.

While one like `any where true | head 2147483640 + 8` fails with `"type": "arithmetic_exception", "reason": "integer overflow"`.
x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/LogicalPlanBuilder.java
}
        NumberContext numberCtx = ctx.timeUnit().number();
        if (numberCtx instanceof IntegerLiteralContext) {
            Number number = (Number) visitIntegerLiteral((IntegerLiteralContext) numberCtx).fold();
            long value = number.longValue();
            if (value <= 0) {
                throw new ParsingException(source(numberCtx), "A positive maxspan value is required; found [{}]", value);
            }
            String timeString = text(ctx.timeUnit().IDENTIFIER());
            if (timeString == null) {
                throw new ParsingException(
                    source(ctx.timeUnit()),
                    "No time unit specified, did you mean [s] as in [{}s]?",
                    text(ctx.timeUnit())
                );
            }
            TimeUnit timeUnit = switch (timeString) {
                case "ms" -> TimeUnit.MILLISECONDS;
                case "s" -> TimeUnit.SECONDS;
                case "m" -> TimeUnit.MINUTES;
                case "h" -> TimeUnit.HOURS;
                case "d" -> TimeUnit.DAYS;
                default -> throw new ParsingException(
                    source(ctx.timeUnit().IDENTIFIER()),
                    "Unrecognized time unit [{}] in [{}], please specify one of [ms, s, m, h, d]",
                    timeString,
                    text(ctx.timeUnit())
                );
            };
            return new TimeValue(value, timeUnit);