### 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
return new Join(source, queries, until, fieldTimestamp(), fieldTiebreaker(), resultPosition());
    }
    private KeyedFilter defaultUntil(Source source) {
        
        return new KeyedFilter(source, new LocalRelation(source, emptyList()), emptyList(), UNSPECIFIED_FIELD, UNSPECIFIED_FIELD, false);
    }
    public KeyedFilter visitJoinTerm(JoinTermContext ctx, List<Attribute> joinKeys, Attribute timestampField, Attribute tiebreakerField) {
        if (ctx.subquery().MISSING_EVENT_OPEN() != null) {
            throw new ParsingException("Missing events are supported only for sequences");
        }
        return keyedFilter(joinKeys, ctx, ctx.by, ctx.subquery(), timestampField, tiebreakerField, false);
    }
    private KeyedFilter keyedFilter(
        List<Attribute> joinKeys,
        ParseTree ctx,
        JoinKeysContext joinCtx,
        SubqueryContext subqueryCtx,
        Attribute timestampField,
        Attribute tiebreakerField,
        boolean missingEvent
    ) {
        List<Attribute> keys = CollectionUtils.combine(joinKeys, visitJoinKeys(joinCtx));
        LogicalPlan eventQuery = visitEventFilter(subqueryCtx.eventFilter());
        return new KeyedFilter(source(ctx), eventQuery, keys, timestampField, tiebreakerField, missingEvent);
    }
    @Override
    public Sequence visitSequence(SequenceContext ctx) {
        Source source = source(ctx);
        if (ctx.disallowed != null && ctx.sequenceParams() != null) {
            throw new ParsingException(source, "Please specify sequence [by] before [with] not after");