### 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
super(params);
    }
    private Attribute fieldTimestamp() {
        return new UnresolvedAttribute(synthetic("<timestamp>"), params.fieldTimestamp());
    }
    private Attribute fieldTiebreaker() {
        return params.fieldTiebreaker() != null
            ? new UnresolvedAttribute(synthetic("<tiebreaker>"), params.fieldTiebreaker())
            : UNSPECIFIED_FIELD;
    }
    private OrderDirection resultPosition() {
        return params.resultPosition();
    }
    @Override
    public Object visitStatement(StatementContext ctx) {
        LogicalPlan plan = plan(ctx.query());
        if (plan instanceof Sample) {
            if (ctx.pipe().size() > 0) {
                throw new ParsingException(source(ctx.pipe().get(0)), "Samples do not support pipes yet");
            }
            return new LimitWithOffset(plan.source(), new Literal(Source.EMPTY, params.size(), DataTypes.INTEGER), 0, plan);
        }
        
        
        
        
        
        boolean asc = resultPosition() == OrderDirection.ASC;
        NullsPosition position = asc ? NullsPosition.FIRST : NullsPosition.LAST;
        List<Order> orders = new ArrayList<>(2);