{"record":{"id":"5fef8430b6565f39","repo":"apache/seatunnel","slug":"cannot-get-split-s-to-get-databasename-and-tabl","errorCode":null,"errorMessage":"Cannot get split '%s' to get databaseName and tableName","messagePattern":"Cannot get split '(.+?)' to get databaseName and tableName","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/TablePath.java","lineNumber":68,"sourceCode":"        return of(fullName, false);\n    }\n\n    public static TablePath of(String fullName, boolean schemaFirst) {\n        String[] paths = fullName.split(\"\\\\.\");\n\n        if (paths.length == 1) {\n            return of(null, paths[0]);\n        }\n        if (paths.length == 2) {\n            if (schemaFirst) {\n                return of(null, paths[0], paths[1]);\n            }\n            return of(paths[0], null, paths[1]);\n        }\n        if (paths.length == 3) {\n            return of(paths[0], paths[1], paths[2]);\n        }\n        throw new IllegalArgumentException(\n                String.format(\"Cannot get split '%s' to get databaseName and tableName\", fullName));\n    }\n\n    public static TablePath of(String databaseName, String tableName) {\n        return of(databaseName, null, tableName);\n    }\n\n    public static TablePath of(String databaseName, String schemaName, String tableName) {\n        return new TablePath(databaseName, schemaName, tableName);\n    }\n\n    public String getSchemaAndTableName() {\n        return getNameCommon(null, schemaName, tableName, null, null);\n    }\n\n    public String getSchemaAndTableName(String quote) {\n        return getNameCommon(null, schemaName, tableName, quote, quote);\n    }","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/TablePath.java#L50-L86","documentation":"TablePath.of(String fullName) splits the full name on separators and only accepts 2 or 3 segments (db.table or db.schema.table). Anything else throws IllegalArgumentException telling you the string could not be split into database and table name.","triggerScenarios":"Calling TablePath.of(fullName) where splitting yields 1 segment (\"mytable\"), or more than 3 segments (\"a.b.c.d\", e.g. names containing dots or JDBC-style prefixes).","commonSituations":"Passing bare table names from configs, passing fully-qualified names with extra qualifiers (cluster.db.schema.table), or names containing dots inside the table identifier.","solutions":["Use TablePath.of(databaseName, tableName) or of(db, schema, table) directly instead of a single ambiguous string","Normalize the string to 2 or 3 dot-separated segments before calling of(fullName)","If the table name itself contains dots, escape/split manually and use the multi-arg constructor"],"exampleFix":"// before\nTablePath.of(\"mytable\"); // throws\n// after\nTablePath.of(\"mydb\", \"mytable\");\n// or normalize first\nString[] parts = fullName.split(\"\\\\.\");\nTablePath.of(parts[parts.length-2], parts[parts.length-1]);","handlingStrategy":"validation","validationCode":"String[] parts = fullName.split(\"\\\\.\");\nif (parts.length < 2 || parts.length > 3) throw new IllegalArgumentException(\"Expected db.table or db.schema.table, got: \" + fullName);","typeGuard":null,"tryCatchPattern":"try { path = TablePath.of(fullName); } catch (IllegalArgumentException e) { log.error(\"Bad table path '{}': use db.table or db.schema.table\", fullName); throw e; }","preventionTips":["Prefer the explicit of(db, table) / of(db, schema, table) over string parsing","Normalize JDBC or catalog-qualified names before calling of(fullName)","Document the accepted formats for full-name inputs"],"tags":["table-path","parsing","argument-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}