### 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
found
                    );
                }
            }
            if (keySize == 0 && hasMissingJoinKeys == false) {
                hasMissingJoinKeys = true;
                missingJoinKeysSource = source(joinTermCtx);
            }
            queries.add(joinTerm);
            int numberOfQueries = queries.size();
            if (numberOfQueries > MAX_SAMPLE_QUERIES) {
                throw new ParsingException(
                    source(joinTermCtx),
                    "A sample cannot contain more than {} queries, found [{}]",
                    MAX_SAMPLE_QUERIES,
                    numberOfQueries
                );
            }
            Set<String> uniqueKeyNames = new HashSet<>(keySize);
            Set<String> duplicateKeyNames = new LinkedHashSet<>(1);
            for (NamedExpression key : joinTerm.keys()) {
                String name = Expressions.name(key);
                if (uniqueKeyNames.contains(name)) {
                    duplicateKeyNames.add(name);
                } else {
                    uniqueKeyNames.add(name);
                }
            }
            if (duplicateKeyNames.size() > 0) {
                Source src = source(joinTermCtx.by != null ? joinTermCtx.by : joinTermCtx);