prestodb/presto · error · PrestoException

INVALID_ARGUMENTS

INVALID_ARGUMENTS

Error message

message (dynamic, from caller)

What it means

BaseProcedure.checkArgument is a helper for procedure implementations that validates caller-supplied arguments at registration or invocation time. If the assertion is false it throws PrestoException with INVALID_ARGUMENTS and the caller-provided message. It fails fast when a procedure is invoked with arguments that violate the procedure's own contract.

Source

Thrown at presto-spi/src/main/java/com/facebook/presto/spi/procedure/BaseProcedure.java:154

        @Override
        public String toString()
        {
            return name + " " + type;
        }
    }

    private static String checkNotNullOrEmpty(String value, String name)
    {
        requireNonNull(value, name + " is null");
        checkArgument(!value.isEmpty(), name + " is empty");
        return value;
    }

    protected static void checkArgument(boolean assertion, String message)
    {
        if (!assertion) {
            throw new PrestoException(INVALID_ARGUMENTS, message);
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Read the message field of the exception; it names exactly which argument failed
  2. Validate all procedure arguments (non-null, non-empty, correct type) before CALL
  3. Check the connector's procedure documentation for required parameters
  4. If invoking programmatically via Session/ProcedureCall, pass literal typed values rather than null

Example fix

// before
session.executeSql("CALL system.sync_partition_metadata('schema', '', false)");
// after
String schemaName = validateNotEmpty(schema); // throws before Presto does
session.executeSql(format("CALL system.sync_partition_metadata('schema', '%s', false)", schemaName));
Defensive patterns

Strategy: validation

Validate before calling

function validateProcedureArgs(args) {
  for (const [name, value] of Object.entries(args)) {
    if (value === null || value === undefined || value === '') {
      throw new Error(`Procedure argument '${name}' must be non-null and non-empty`);
    }
  }
}

Type guard

static boolean isNonEmptyString(Object v) {
    return v instanceof String && !((String) v).isEmpty();
}

Try / catch

try {
    connection.createStatement().execute(procedureCall);
} catch (SQLException e) {
    if (e.getMessage() != null && e.getMessage().contains("INVALID_ARGUMENTS")) {
        // log offending arguments and correct them before retry
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling a connector system.procedure with arguments that fail the procedure's checkArgument(assertion, message) checks, e.g. empty or null strings rejected via checkNotNullOrEmpty.

Common situations: Calling procedures like system.sync_partition_metadata or connector-specific maintenance procedures with missing/empty parameters; scripting tools passing blank variables into CALL statements.

Related errors


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