{"record":{"id":"c4c72a41f86ae098","repo":"prestodb/presto","slug":"selector-specifies-an-invalid-query-type-s","errorCode":null,"errorMessage":"Selector specifies an invalid query type: %s","messagePattern":"Selector specifies an invalid query type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/AbstractResourceConfigurationManager.java","lineNumber":136,"sourceCode":"                    .stream()\n                    .filter(groupSpec -> groupSpec.getName().equals(groupName))\n                    .findFirst();\n            if (!match.isPresent()) {\n                throw new IllegalArgumentException(format(\"Selector refers to nonexistent group: %s\", fullyQualifiedGroupName.toString()));\n            }\n            fullyQualifiedGroupName.append(\".\");\n            groups = match.get().getSubGroups();\n            selectorGroups = selectorGroups.subList(1, selectorGroups.size());\n        }\n    }\n\n    private void validateQueryType(String queryType)\n    {\n        try {\n            QueryType.valueOf(queryType.toUpperCase());\n        }\n        catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(format(\"Selector specifies an invalid query type: %s\", queryType));\n        }\n    }\n\n    protected AbstractResourceConfigurationManager(ClusterMemoryPoolManager memoryPoolManager)\n    {\n        memoryPoolManager.addChangeListener(new MemoryPoolId(\"general\"), poolInfo -> {\n            Map<ResourceGroup, DataSize> memoryLimits = new HashMap<>();\n            synchronized (generalPoolMemoryFraction) {\n                for (Map.Entry<ResourceGroup, Double> entry : generalPoolMemoryFraction.entrySet()) {\n                    double bytes = poolInfo.getMaxBytes() * entry.getValue();\n                    // setSoftMemoryLimit() acquires a lock on the root group of its tree, which could cause a deadlock if done while holding the \"generalPoolMemoryFraction\" lock\n                    memoryLimits.put(entry.getKey(), new DataSize(bytes, BYTE));\n                }\n                generalPoolBytes = poolInfo.getMaxBytes();\n            }\n            for (Map.Entry<ResourceGroup, DataSize> entry : memoryLimits.entrySet()) {\n                entry.getKey().setSoftMemoryLimit(entry.getValue());\n            }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/AbstractResourceConfigurationManager.java#L118-L154","documentation":"Thrown by validateQueryType when a selector in the resource group configuration declares a queryType value that does not match any QueryType enum constant (compared case-insensitively). The manager wraps QueryType.valueOf's IllegalArgumentException with a clearer message pointing at the bad selector value.","triggerScenarios":"A ResourceGroupSelector spec in JSON/config contains queryType set to a string that is not a valid QueryType constant (e.g. 'QUERY', 'SLECT', 'select-all'); validateQueryType is called while matching selectors via getMatchingSpec.","commonSituations":"Typo in the query_type property of a selector in resource group config JSON; using lowercase variants of removed enum names; upgrading Presto where QueryType constants changed.","solutions":["Set queryType to a valid QueryType enum constant (e.g. SELECT, INSERT, DATA_DEFINITION) — case is normalized, spelling must match","Check the configured value against the QueryType enum for your Presto version","Remove the queryType property from the selector if filtering by query type is not needed"],"exampleFix":"// before (resource-groups.json)\n{\"queryType\": \"SELECRT\", ...}\n// after\n{\"queryType\": \"SELECT\", ...}","handlingStrategy":"validation","validationCode":"Set<String> valid = Arrays.stream(QueryType.values()).map(Enum::name).collect(Collectors.toSet());\nif (queryType == null || !valid.contains(queryType.toUpperCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"Invalid queryType in selector: \" + queryType);\n}","typeGuard":null,"tryCatchPattern":"try { QueryType.valueOf(queryType.toUpperCase()); } catch (IllegalArgumentException e) { /* reject config entry, log the bad selector */ }","preventionTips":["Only use values from the QueryType enum in selector configs","Lint resource group config against the enum at deploy time","Add a startup self-check that validates all selectors"],"tags":["presto","resource-groups","configuration"],"backgroundTag":"invalid-enum-value","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"}