{"record":{"id":"e500741f167eb76c","repo":"prestodb/presto","slug":"invalid-table-property-e50074","errorCode":"INVALID_TABLE_PROPERTY","errorMessage":"Locality groups string is malformed. See documentation for proper format.","messagePattern":"Locality groups string is malformed\\. See documentation for proper format\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/conf/AccumuloTableProperties.java","lineNumber":194,"sourceCode":"     */\n    public static Optional<Map<String, Set<String>>> getLocalityGroups(Map<String, Object> tableProperties)\n    {\n        requireNonNull(tableProperties);\n\n        @SuppressWarnings(\"unchecked\")\n        String groupStr = (String) tableProperties.get(LOCALITY_GROUPS);\n        if (groupStr == null) {\n            return Optional.empty();\n        }\n\n        ImmutableMap.Builder<String, Set<String>> groups = ImmutableMap.builder();\n\n        // Split all configured locality groups\n        for (String group : PIPE_SPLITTER.split(groupStr)) {\n            String[] locGroups = Iterables.toArray(COLON_SPLITTER.split(group), String.class);\n\n            if (locGroups.length != 2) {\n                throw new PrestoException(INVALID_TABLE_PROPERTY, \"Locality groups string is malformed. See documentation for proper format.\");\n            }\n\n            String grpName = locGroups[0];\n            ImmutableSet.Builder<String> colSet = ImmutableSet.builder();\n\n            for (String f : COMMA_SPLITTER.split(locGroups[1])) {\n                colSet.add(f.toLowerCase(Locale.ENGLISH));\n            }\n\n            groups.put(grpName.toLowerCase(Locale.ENGLISH), colSet.build());\n        }\n\n        return Optional.of(groups.build());\n    }\n\n    public static Optional<String> getRowId(Map<String, Object> tableProperties)\n    {\n        requireNonNull(tableProperties);","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/conf/AccumuloTableProperties.java#L176-L212","documentation":"Thrown by AccumuloTableProperties.getLocalityGroups when the locality_groups table property string cannot be parsed. The format must be pipe-separated groups, each 'groupName:col1,col2,...' with exactly one colon per group. Any group segment that does not split into exactly two colon-delimited parts throws INVALID_TABLE_PROPERTY.","triggerScenarios":"CREATE TABLE ... WITH (locality_groups='...') where a group segment contains zero or multiple colons, e.g. 'grpA' (no colon), 'grpA:col1:col2' (two colons), an empty segment from a trailing pipe 'grpA:col1|', or groups separated by commas instead of pipes.","commonSituations":"Copy-pasting locality group config with the wrong separator; forgetting to quote the property string in SQL so a colon or pipe is misinterpreted; leaving a trailing/duplicate pipe producing an empty group; writing groups in the wrong order or with wrong delimiters.","solutions":["Rewrite the locality_groups value so every pipe-separated segment has exactly one colon: 'group1:colA,colB|group2:colC'.","Use pipes between groups and commas between column names within a group - never commas between groups.","Remove empty segments (trailing or duplicate pipes) from the string.","Quote the property string in SQL so colons and pipes survive parsing.","Check the Accumulo connector documentation for the exact expected format before re-running the DDL."],"exampleFix":"-- before\nCREATE TABLE t (...) WITH (locality_groups='meta:foo:bar,stats:cnt');\n-- after\nCREATE TABLE t (...) WITH (locality_groups='meta:foo,bar|stats:cnt');","handlingStrategy":"validation","validationCode":"boolean validLocalityGroups(String s) {\n    if (s == null) return true;\n    return java.util.Arrays.stream(s.split(\"\\\\|\", -1))\n        .allMatch(g -> g.split(\":\", -1).length == 2);\n}\n// call before CREATE TABLE: if (!validLocalityGroups(groupsStr)) throw new IllegalArgumentException(\"malformed locality_groups\");","typeGuard":"boolean isWellFormedGroup(String group) {\n    String[] parts = group.split(\":\", -1);\n    return parts.length == 2 && !parts[0].isEmpty() && !parts[1].isEmpty();\n}","tryCatchPattern":"try {\n    createTableWithLocalityGroups(props);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"INVALID_TABLE_PROPERTY\")) {\n        // fix the locality_groups string: 'group1:colA,colB|group2:colC'\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always format locality groups as 'name:col1,col2|name2:col3' - pipes between groups, commas between columns, exactly one colon per group.","Validate the string with a quick split check before embedding it in DDL.","Quote the property value in SQL so separators are not mangled.","Never leave a trailing or leading pipe in the property string."],"tags":["accumulo","table-properties","config-parse","locality-groups"],"backgroundTag":"invalid-table-property","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"}