{"record":{"id":"fa74899867eef422","repo":"prestodb/presto","slug":"qualifiedobjectname-should-have-exactly-3-parts-f","errorCode":null,"errorMessage":"QualifiedObjectName should have exactly 3 parts, found %s: %s","messagePattern":"QualifiedObjectName should have exactly 3 parts, found (.+?): (.+?)","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/QualifiedObjectName.java","lineNumber":45,"sourceCode":"import static java.util.Locale.ENGLISH;\nimport static java.util.Objects.requireNonNull;\n\n@Immutable\n@ThriftStruct\npublic class QualifiedObjectName\n{\n    private final String catalogName;\n    private final String schemaName;\n    private final String objectName;\n\n    @JsonCreator\n    public static QualifiedObjectName valueOf(String name)\n    {\n        requireNonNull(name, \"name is null\");\n\n        String[] parts = name.split(\"\\\\.\");\n        if (parts.length != 3) {\n            throw new IllegalArgumentException(format(\"QualifiedObjectName should have exactly 3 parts, found %s: %s\", parts.length, name));\n        }\n\n        return new QualifiedObjectName(parts[0], parts[1], parts[2]);\n    }\n\n    public static QualifiedObjectName valueOf(CatalogSchemaName catalogSchemaName, String objectName)\n    {\n        return new QualifiedObjectName(catalogSchemaName.getCatalogName(), catalogSchemaName.getSchemaName(), objectName.toLowerCase(ENGLISH));\n    }\n\n    public static QualifiedObjectName valueOf(String catalogName, String schemaName, String objectName)\n    {\n        return new QualifiedObjectName(catalogName, schemaName, objectName.toLowerCase(ENGLISH));\n    }\n\n    @JsonCreator\n    @ThriftConstructor\n    public QualifiedObjectName(","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/QualifiedObjectName.java#L27-L63","documentation":"QualifiedObjectName.valueOf(String) parses a fully qualified object name of the form catalog.schema.table. It throws this IllegalArgumentException when splitting the string on '.' does not yield exactly 3 parts, since a qualified object name must have all three components.","triggerScenarios":"Passing a name string with fewer or more than 2 dots to QualifiedObjectName.valueOf() — e.g. \"mytable\", \"schema.table\", \"catalog.schema.table.column\", or names containing extra dots.","commonSituations":"Configuration/SQL properties where users provide unqualified or partially qualified table names; quoted identifiers or dots inside identifier parts that break the naive split; programmatic string concatenation producing a 4-part path.","solutions":["Supply the name in catalog.schema.table form, e.g. \"hive.default.my_table\".","If parts come from separate variables, use QualifiedObjectName.valueOf(CatalogSchemaName, objectName) or the constructor instead of joining strings.","Escape or strip unwanted dots, or parse user input yourself and reject invalid formats with a friendly message before calling valueOf().","Handle quoted identifiers by removing quotes before parsing, since split(\"\\.\") does not honor SQL quoting."],"exampleFix":"// before\nQualifiedObjectName name = QualifiedObjectName.valueOf(\"hive.default\"); // throws\n// after\nString tableName = requireNonNull(tableNameFromConfig);\nQualifiedObjectName name = QualifiedObjectName.valueOf(\"hive.default.\" + tableName);","handlingStrategy":"validation","validationCode":"String[] parts = name.split(\"\\\\.\");\nif (parts.length != 3) {\n    throw new IllegalArgumentException(\"expected catalog.schema.table, got: \" + name);\n}\nQualifiedObjectName obj = QualifiedObjectName.valueOf(name);","typeGuard":"boolean isQualifiedObjectName(String name) {\n    return name != null && name.split(\"\\\\.\", -1).length == 3;\n}","tryCatchPattern":"try {\n    QualifiedObjectName name = QualifiedObjectName.valueOf(raw);\n} catch (IllegalArgumentException e) {\n    throw new IllegalArgumentException(\"table name must be catalog.schema.table format\", e);\n}","preventionTips":["Always pass fully qualified catalog.schema.table strings.","Prefer the valueOf(CatalogSchemaName, String) overload when components are separate.","Strip quotes and validate user-supplied table names before parsing.","Handle quoted identifiers manually; split(\"\\.\") ignores SQL quoting."],"tags":["presto","parsing","object-name","illegal-argument"],"backgroundTag":"invalid-identifier-format","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"}