### 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
assertEquals(UnresolvedAttribute.class, key.getClass());
        assertEquals("pid", key.name());
        key = keys.get(1);
        assertEquals(UnresolvedAttribute.class, key.getClass());
        assertEquals("host_name", key.name());
        subPlan = queries.get(1);
        assertEquals(KeyedFilter.class, subPlan.getClass());
        kf = (KeyedFilter) subPlan;
        keys = kf.keys();
        key = keys.get(0);
        assertEquals(UnresolvedAttribute.class, key.getClass());
        assertEquals("pid", key.name());
        key = keys.get(1);
        assertEquals(UnresolvedAttribute.class, key.getClass());
        assertEquals("host", key.name());
    }
    private LogicalPlan wrapFilter(Expression exp) {
        LogicalPlan filter = new Filter(Source.EMPTY, relation(), exp);
        Order order = new Order(Source.EMPTY, timestamp(), OrderDirection.ASC, NullsPosition.FIRST);
        LogicalPlan sorted = new OrderBy(Source.EMPTY, filter, singletonList(order));
        return new Head(Source.EMPTY, new Literal(Source.EMPTY, RequestDefaults.SIZE, DataTypes.INTEGER), sorted);
    }
    private LogicalPlan defaultPipes(LogicalPlan plan) {
        assertTrue(plan instanceof LimitWithOffset);
        plan = ((LimitWithOffset) plan).child();
        assertTrue(plan instanceof OrderBy);
        return ((OrderBy) plan).child();
    }
}