{"record":{"id":"fff51e1099840dcc","repo":"prestodb/presto","slug":"invalid-arguments-fff51e","errorCode":"INVALID_ARGUMENTS","errorMessage":"message (dynamic, from caller)","messagePattern":"message \\(dynamic, from caller\\)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-spi/src/main/java/com/facebook/presto/spi/procedure/BaseProcedure.java","lineNumber":154,"sourceCode":"\n        @Override\n        public String toString()\n        {\n            return name + \" \" + type;\n        }\n    }\n\n    private static String checkNotNullOrEmpty(String value, String name)\n    {\n        requireNonNull(value, name + \" is null\");\n        checkArgument(!value.isEmpty(), name + \" is empty\");\n        return value;\n    }\n\n    protected static void checkArgument(boolean assertion, String message)\n    {\n        if (!assertion) {\n            throw new PrestoException(INVALID_ARGUMENTS, message);\n        }\n    }\n}\n","sourceCodeStart":136,"sourceCodeEnd":158,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spi/src/main/java/com/facebook/presto/spi/procedure/BaseProcedure.java#L136-L158","documentation":"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.","triggerScenarios":"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.","commonSituations":"Calling procedures like system.sync_partition_metadata or connector-specific maintenance procedures with missing/empty parameters; scripting tools passing blank variables into CALL statements.","solutions":["Read the message field of the exception; it names exactly which argument failed","Validate all procedure arguments (non-null, non-empty, correct type) before CALL","Check the connector's procedure documentation for required parameters","If invoking programmatically via Session/ProcedureCall, pass literal typed values rather than null"],"exampleFix":"// before\nsession.executeSql(\"CALL system.sync_partition_metadata('schema', '', false)\");\n// after\nString schemaName = validateNotEmpty(schema); // throws before Presto does\nsession.executeSql(format(\"CALL system.sync_partition_metadata('schema', '%s', false)\", schemaName));","handlingStrategy":"validation","validationCode":"function validateProcedureArgs(args) {\n  for (const [name, value] of Object.entries(args)) {\n    if (value === null || value === undefined || value === '') {\n      throw new Error(`Procedure argument '${name}' must be non-null and non-empty`);\n    }\n  }\n}","typeGuard":"static boolean isNonEmptyString(Object v) {\n    return v instanceof String && !((String) v).isEmpty();\n}","tryCatchPattern":"try {\n    connection.createStatement().execute(procedureCall);\n} catch (SQLException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"INVALID_ARGUMENTS\")) {\n        // log offending arguments and correct them before retry\n    }\n    throw e;\n}","preventionTips":["Validate all CALL arguments client-side before submitting","Consult connector docs for required procedure parameters","Never pass empty strings or NULLs where the procedure expects identifiers"],"tags":["procedure","invalid-arguments","validation"],"backgroundTag":"invalid-procedure-arguments","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}