### 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
import org.elasticsearch.xpack.ql.expression.UnresolvedAttribute;
import org.elasticsearch.xpack.ql.expression.predicate.logical.And;
import org.elasticsearch.xpack.ql.expression.predicate.operator.comparison.Equals;
import org.elasticsearch.xpack.ql.plan.logical.Filter;
import org.elasticsearch.xpack.ql.plan.logical.LogicalPlan;
import org.elasticsearch.xpack.ql.plan.logical.OrderBy;
import org.elasticsearch.xpack.ql.plan.logical.UnresolvedRelation;
import org.elasticsearch.xpack.ql.tree.Source;
import org.elasticsearch.xpack.ql.type.DataTypes;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static java.util.Collections.singletonList;
import static org.elasticsearch.xpack.ql.type.DateUtils.UTC;
public class LogicalPlanTests extends ESTestCase {
    private final EqlParser parser = new EqlParser();
    private Expression expr(String source) {
        return parser.createExpression(source);
    }
    private static Attribute timestamp() {
        return new UnresolvedAttribute(Source.EMPTY, "@timestamp");
    }
    private static LogicalPlan relation() {
        return new UnresolvedRelation(Source.EMPTY, null, "", false, "");
    }
    public void testAnyQuery() {
        LogicalPlan fullQuery = parser.createStatement("any where process_name == \"net.exe\"");
        Expression fullExpression = expr("process_name == \"net.exe\"");
        assertEquals(wrapFilter(fullExpression), fullQuery);
    }
    public void testEventQuery() {