### 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
LogicalPlan plan = parser.createStatement(
            "sequence by pid with maxspan=2s "
                + "    [\"12\\\"34!@#$\" where process_name == \"test.exe\" ] "
                + "    [\"\"\"!@#$%test\"\"\\)(*&^\"\"\" where file_path == \"test.exe\"]"
        );
        plan = defaultPipes(plan);
        assertEquals(Sequence.class, plan.getClass());
        Sequence seq = (Sequence) plan;
        assertEquals(KeyedFilter.class, seq.until().getClass());
        assertEquals(LocalRelation.class, seq.until().child().getClass());
        List<? extends LogicalPlan> queries = seq.queries();
        assertEquals(2, queries.size());
        LogicalPlan query1 = queries.get(0);
        assertEquals(KeyedFilter.class, query1.getClass());
        KeyedFilter kf = (KeyedFilter) query1;
        assertEquals(Filter.class, kf.child().getClass());
        Filter f = (Filter) kf.child();
        assertEquals(And.class, f.condition().getClass());
        assertEquals(Equals.class, ((And) f.condition()).left().getClass());
        Equals eq = (Equals) ((And) f.condition()).left();
        assertEquals("12\"34!@#$", eq.right().fold());
        LogicalPlan query2 = queries.get(1);
        assertEquals(KeyedFilter.class, query2.getClass());
        kf = (KeyedFilter) query2;
        assertEquals(Filter.class, kf.child().getClass());
        f = (Filter) kf.child();
        assertEquals(And.class, f.condition().getClass());
        assertEquals(Equals.class, ((And) f.condition()).left().getClass());
        eq = (Equals) ((And) f.condition()).left();
        assertEquals("!@#$%test\"\"\\)(*&^", eq.right().fold());