### 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
StringJoiner duplicates = new StringJoiner(",");
                for (String duplicate : duplicateKeyNames) {
                    duplicates.add(duplicate);
                }
                throw new ParsingException(src, "Join keys must be used only once, found duplicates: [{}]", duplicates.toString());
            }
        }
        if (queries.size() < 2) {
            throw new ParsingException(source, "A sample requires a minimum of 2 queries, found [{}]", queries.size());
        }
        if (hasMissingJoinKeys) {
            throw new ParsingException(missingJoinKeysSource, "A sample must have at least one join key, found none");
        }
        return new Sample(source, queries);
    }
    private LogicalPlan pipe(PipeContext ctx, LogicalPlan plan) {
        String name = text(ctx.IDENTIFIER());
        if (SUPPORTED_PIPES.contains(name) == false) {
            List<String> potentialMatches = StringUtils.findSimilar(name, SUPPORTED_PIPES);
            String msg = "Unrecognized pipe [{}]";
            if (potentialMatches.isEmpty() == false) {
                String matchString = potentialMatches.toString();
                msg += ", did you mean " + (potentialMatches.size() == 1 ? matchString : "any of " + matchString) + "?";
            }
            throw new ParsingException(source(ctx.IDENTIFIER()), msg, name);
        }
        switch (name) {
            case HEAD_PIPE -> {
                Expression headLimit = pipeIntArgument(source(ctx), name, ctx.booleanExpression());
                return new Head(source(ctx), headLimit, plan);