{"record":{"id":"4488a11b46bc97a2","repo":"prestodb/presto","slug":"not-found-4488a1","errorCode":"NOT_FOUND","errorMessage":"%s is empty","messagePattern":"(.+?) is empty","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-spi/src/main/java/com/facebook/presto/spi/SchemaUtil.java","lineNumber":31,"sourceCode":" */\npackage com.facebook.presto.spi;\n\nimport static com.facebook.presto.spi.StandardErrorCode.NOT_FOUND;\nimport static java.lang.String.format;\n\nfinal class SchemaUtil\n{\n    private SchemaUtil()\n    {\n    }\n\n    static String checkNotEmpty(String value, String name)\n    {\n        if (value == null) {\n            throw new NullPointerException(name + \" is null\");\n        }\n        if (value.isEmpty()) {\n            throw new PrestoException(NOT_FOUND, format(\"%s is empty\", name));\n        }\n        return value;\n    }\n}\n","sourceCodeStart":13,"sourceCodeEnd":36,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spi/src/main/java/com/facebook/presto/spi/SchemaUtil.java#L13-L36","documentation":"SchemaUtil.checkNotEmpty is an internal guard used by SPI implementations to reject empty string parameters. It throws PrestoException(NOT_FOUND, \"<name> is empty\") when the value is an empty string (null produces a plain NullPointerException instead).","triggerScenarios":"Any SPI method whose implementation calls SchemaUtil.checkNotEmpty (e.g. schema/source/catalog name validation) with an empty string argument, such as getSchemaNames/getTableHandle receiving schema=\"\".","commonSituations":"Missing configuration property leaving a schema or source name as empty string; user-supplied identifier that was trimmed to nothing; connector config like a hive schema property set to \"\".","solutions":["Provide a non-empty value for the named parameter in your query/config","Check connector configuration properties for empty-string values and set proper defaults","Wrap calls and catch PrestoException with code NOT_FOUND to surface a clearer message to the user"],"exampleFix":"// before\nconnector.getSchemaNames(\"\");\n// after\nconnector.getSchemaNames(\"default\");","handlingStrategy":"validation","validationCode":"if (value == null || value.isEmpty()) throw new IllegalArgumentException(name + \" must be non-empty\");","typeGuard":null,"tryCatchPattern":"try { ... } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.NOT_FOUND.toErrorCodeCode()) { /* handle empty identifier */ } throw e; }","preventionTips":["Validate config properties with @NotEmpty or explicit checks at connector startup","Never pass user input straight into schema/source identifiers without trimming and emptiness checks"],"tags":["spi","presto-exception","empty-argument"],"backgroundTag":"empty-string-argument","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"}