prestodb/presto · error · IllegalStateException

Unsupported query type: %s

Error message

Unsupported query type: %s

What it means

VerificationFactory.get dispatches a QueryType to the corresponding verification class (QueryVerification, CreateTableVerification, CreateViewVerification, CreateTableAsSelectVerification, etc.) via a switch. A QueryType with no case reaches default and throws IllegalStateException with this message, meaning the verifier does not know how to execute that statement type.

Source

Thrown at presto-verifier/src/main/java/com/facebook/presto/verifier/framework/VerificationFactory.java:170

                        verificationContext,
                        verifierConfig,
                        executor,
                        snapshotQueryConsumer,
                        snapshotQueries);
            case CREATE_TABLE:
                return new CreateTableVerification(
                        sqlParser,
                        queryActions,
                        sourceQuery,
                        queryRewriter,
                        exceptionClassifier,
                        verificationContext,
                        verifierConfig,
                        executor,
                        snapshotQueryConsumer,
                        snapshotQueries);
            default:
                throw new IllegalStateException(format("Unsupported query type: %s", queryType));
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the queryType value in the message and the suite's SQL — remove or move unsupported statement types to a different suite.
  2. Add a case in VerificationFactory.get mapping the new QueryType to a verification implementation.
  3. Ensure the verifier configuration files match what this verifier build supports.
  4. Upgrade/downgrade the verifier so the enum and factory agree.

Example fix

// before
default:
    throw new IllegalStateException(format("Unsupported query type: %s", queryType));
// after
case CREATE_OR_REPLACE_VIEW:
    return new CreateOrReplaceViewVerification(...);
default:
    throw new IllegalStateException(format("Unsupported query type: %s", queryType));
Defensive patterns

Strategy: validation

Validate before calling

// Java: pre-check supported query types before dispatch
EnumSet<QueryType> supported = EnumSet.of(SELECT, CREATE_TABLE, CREATE_TABLE_AS_SELECT, CREATE_VIEW, CREATE_VIEW_AS_SELECT, CREATE_OR_REPLACE_VIEW, CREATE_FUNCTION, DESCRIBE, EXPLAIN, INSERT, DELETE, REFRESH, CREATE_MATERIALIZED_VIEW, DROP_TABLE);
if (!supported.contains(queryType)) {
    throw new IllegalArgumentException("Query type not supported by this verifier build: " + queryType);
}

Try / catch

try {
    verification = factory.get(...);
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("Unsupported query type")) {
        report.skip(query, e.getMessage());
        return;
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling factory.get(...) (e.g. from verify) with a suite whose QueryType enum value is not handled by the switch — typically after a new QueryType was added or an unhandled statement kind (INSERT/DELETE/DESCRIBE) appears in the verifier configuration.

Common situations: Running the verifier against a suite containing unsupported statement types; adding a QueryType enum constant without extending VerificationFactory; version skew between the verifier config generator and the verifier binary.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/654e1901e700ac46. Report an issue: GitHub.