### 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
} else {
                plan = new Tail(defaultLimitSource, defaultSize, plan);
            }
        }
        return plan;
    }
    @Override
    public LogicalPlan visitEventQuery(EqlBaseParser.EventQueryContext ctx) {
        return visitEventFilter(ctx.eventFilter());
    }
    @Override
    public LogicalPlan visitEventFilter(EventFilterContext ctx) {
        Source source = source(ctx);
        Expression condition = expression(ctx.expression());
        if (ctx.event != null) {
            Source eventSource = source(ctx.event);
            String eventName = ctx.event.getText();
            if (eventName.startsWith("\"") || eventName.startsWith("'") || eventName.startsWith("?")) {
                eventName = unquoteString(source(ctx.event));
            }
            Literal eventValue = new Literal(eventSource, eventName, DataTypes.KEYWORD);
            UnresolvedAttribute eventField = new UnresolvedAttribute(eventSource, params.fieldEventCategory());
            Expression eventMatch = new Equals(eventSource, eventField, eventValue, params.zoneId());
            condition = new And(source, eventMatch, condition);
        }
        return new Filter(source, RELATION, condition);
    }
    @Override
    public Join visitJoin(JoinContext ctx) {
        List<Attribute> parentJoinKeys = visitJoinKeys(ctx.by);