### 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
}
            case TAIL_PIPE -> {
                Expression tailLimit = pipeIntArgument(source(ctx), name, ctx.booleanExpression());
                
                return new Tail(source(ctx), tailLimit, plan);
            }
            default -> throw new ParsingException(source(ctx), "Pipe [{}] is not supported", name);
        }
    }
    private Expression onlyOnePipeArgument(Source source, String pipeName, List<BooleanExpressionContext> exps) {
        int size = CollectionUtils.isEmpty(exps) ? 0 : exps.size();
        if (size != 1) {
            throw new ParsingException(source, "Pipe [{}] expects exactly one argument but found [{}]", pipeName, size);
        }
        return expression(exps.get(0));
    }
    private Expression pipeIntArgument(Source source, String pipeName, List<BooleanExpressionContext> exps) {
        Expression expression = onlyOnePipeArgument(source, pipeName, exps);
        if (expression.dataType().isInteger() == false || expression.foldable() == false || (int) expression.fold() < 0) {
            throw new ParsingException(
                expression.source(),
                "Pipe [{}] expects a positive integer but found [{}]",
                pipeName,
                expression.sourceText()
            );
        }
        return expression;
    }
}