apache/cassandra · error · InvalidRequestException

the ' ' operation is not supported between and

Error message

the '%s' operation is not supported between %s and %s

What it means

FunctionResolver.pickBestMatch(), reached from get(), throws this when no candidate overload matches the provided argument types and the requested name is a binary operation: it reports the operator and the two provided argument types. This is the operation-specific 'no matching signature' error.

Solutions

  1. Make the operand types compatible: wrap the literal in the proper type conversion function (e.g. toDate, toTimestamp) or use a correctly-typed literal
  2. Compare only same-type values (uuid = uuidAsText removed; cast the literal client-side)
  3. Check the column types with DESC TABLE and adjust the query operands to match
  4. Restructure the query so the operation happens in application code on typed values

Example fix

// before
SELECT * FROM t WHERE tscol > 5;
// after
SELECT * FROM t WHERE tscol > toTimestamp(now()); -- or a proper timestamp literal
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof literal !== columnJsType) throw new Error(`literal type ${typeof literal} does not match column type for comparison`);

Type guard

const sameType = (a, b) => a.constructor === b.constructor;

Try / catch

try { rs = session.execute(q); } catch (InvalidRequestException e) { if (e.getMessage().includes('operation is not supported between')) { /* convert operands to matching types */ } else throw e; }

Prevention

When it happens

Trigger: Binary operations between incompatible types, e.g. `intcol + textcol`, `datecol - doublecol`, `tscol * 2`, or comparisons like `WHERE uuidcol > 5` routed through operation resolution.

Common situations: Comparing a UUID/date column to a string/number literal in WHERE; mixing counter with float; filtering with typed literals that don't match the column type.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/3df240f0e57917e4. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java:160

                AssignmentTestable.TestResult r = matchAguments(keyspace, toTest, providedArgs, receiverKeyspace, receiverTable);
                switch (r)
                {
                    case EXACT_MATCH:
                        // We always favor exact matches
                        return toTest;
                    case WEAKLY_ASSIGNABLE:
                        if (compatibles == null)
                            compatibles = new ArrayList<>();
                        compatibles.add(toTest);
                        break;
                }
            }
        }

        if (compatibles == null)
        {
            if (OperationFcts.isOperation(name))
                throw invalidRequest("the '%s' operation is not supported between %s and %s",
                                     OperationFcts.getOperator(name), providedArgs.get(0), providedArgs.get(1));

            throw invalidRequest("Invalid call to function %s, none of its type signatures match (known type signatures: %s)",
                                 name, format(candidates));
        }

        if (compatibles.size() > 1)
        {
            if (OperationFcts.isOperation(name))
            {
                if (receiverType != null && !containsMarkers(providedArgs))
                {
                    for (Function toTest : compatibles)
                    {
                        List<AbstractType<?>> argTypes = toTest.argTypes();
                        if (receiverType.equals(argTypes.get(0)) && receiverType.equals(argTypes.get(1)))
                            return toTest;
                    }

View on GitHub (pinned to 88fd0f6a0e)