### 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/planner/QueryTranslatorFailTests.java
assertThat(
            errorParsing("sample by pid with maxspan=1h [any where true] [any where true]"),
            startsWith("1:15: mismatched input 'with' expecting {'[', '!['}")
        );
        assertThat(
            errorParsing("sample with maxspan=1h [any where true] by pid [any where true] by pid"),
            startsWith("1:8: mismatched input 'with' expecting {'by', '[', '!['}")
        );
        assertThat(
            errorParsing("sample by pid [any where true] [any where true] until [process where event.type == \"termination\"]"),
            startsWith("1:49: mismatched input 'until' expecting {")
        );
        assertThat(
            errorParsing("sample by pid [any where true] with runs=2 [any where true]"),
            startsWith("1:32: mismatched input 'with' expecting {")
        );
        assertThat(errorParsing("sample [any where true] with repeat=123"), startsWith("1:25: mismatched input 'with' expecting {"));
    }
    public void testSampleWithDuplicateKeys() {
        assertThat(
            errorParsing("sample by ?x, host [success where true] by ?x [failure where true] by ?y"),
            startsWith("1:42: Join keys must be used only once, found duplicates: [x]")
        );
        assertThat(
            errorParsing("sample by host [success where true] by ?x [failure where true] by host"),
            startsWith("1:65: Join keys must be used only once, found duplicates: [host]")
        );
    }
}