### 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/test/java/org/elasticsearch/xpack/eql/parser/LogicalPlanTests.java
List<? extends NamedExpression> keys = kf.keys();
        NamedExpression key = keys.get(0);
        assertEquals(UnresolvedAttribute.class, key.getClass());
        assertEquals("pid", key.name());
        TimeValue maxSpan = seq.maxSpan();
        assertEquals(new TimeValue(2, TimeUnit.SECONDS), maxSpan);
    }
    public void testRepeatedQuery() throws Exception {
        LogicalPlan plan = parser.createStatement("sequence " + " [any where true] with runs=2" + " [any where true]");
        plan = defaultPipes(plan);
        assertEquals(Sequence.class, plan.getClass());
        Sequence seq = (Sequence) plan;
        List<? extends LogicalPlan> queries = seq.queries();
        assertEquals(3, queries.size());
    }
    public void testSamplePlan() {
        LogicalPlan plan = parser.createStatement(
            "sample by pid [process where process_name == \"*\" ] by host_name [file where file_path == \"*\"] by host"
        );
        assertTrue(plan instanceof LimitWithOffset);
        plan = ((LimitWithOffset) plan).child();
        assertEquals(Sample.class, plan.getClass());
        Sample sample = (Sample) plan;
        List<? extends LogicalPlan> queries = sample.queries();
        assertEquals(2, queries.size());
        LogicalPlan subPlan = queries.get(0);
        assertEquals(KeyedFilter.class, subPlan.getClass());
        KeyedFilter kf = (KeyedFilter) subPlan;
        List<? extends NamedExpression> keys = kf.keys();
        NamedExpression key = keys.get(0);