{"record":{"id":"85ac5c17b669a9c8","repo":"prestodb/presto","slug":"invalid-session-property-85ac5c","errorCode":"INVALID_SESSION_PROPERTY","errorMessage":"Allowed options for query_types_enabled_for_history_based_optimization are: %s","messagePattern":"Allowed options for query_types_enabled_for_history_based_optimization are: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java","lineNumber":1031,"sourceCode":"    {\n        return queryTypesEnabledForHbo;\n    }\n\n    @Config(\"optimizer.query-types-enabled-for-hbo\")\n    public FeaturesConfig setQueryTypesEnabledForHbo(String queryTypesEnabledForHbo)\n    {\n        this.queryTypesEnabledForHbo = parseQueryTypesFromString(queryTypesEnabledForHbo);\n        return this;\n    }\n\n    public static List<QueryType> parseQueryTypesFromString(String queryTypes)\n    {\n        try {\n            return Splitter.on(\",\").trimResults().splitToList(queryTypes).stream()\n                    .map(QueryType::valueOf).collect(toImmutableList());\n        }\n        catch (Exception e) {\n            throw new PrestoException(INVALID_SESSION_PROPERTY, format(\"Allowed options for query_types_enabled_for_history_based_optimization are: %s\",\n                    Stream.of(QueryType.values())\n                            .map(QueryType::name)\n                            .collect(joining(\",\"))));\n        }\n    }\n\n    public boolean isLogPlansUsedInHistoryBasedOptimizer()\n    {\n        return logPlansUsedInHistoryBasedOptimizer;\n    }\n\n    @Config(\"optimizer.log-plans-used-in-history-based-optimizer\")\n    public FeaturesConfig setLogPlansUsedInHistoryBasedOptimizer(boolean logPlansUsedInHistoryBasedOptimizer)\n    {\n        this.logPlansUsedInHistoryBasedOptimizer = logPlansUsedInHistoryBasedOptimizer;\n        return this;\n    }\n","sourceCodeStart":1013,"sourceCodeEnd":1049,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/FeaturesConfig.java#L1013-L1049","documentation":"When configuring history-based optimization, FeaturesConfig parses the comma-separated query_types list by calling QueryType.valueOf on each entry; any unrecognized value (or null) throws PrestoException INVALID_SESSION_PROPERTY listing the allowed QueryType names. This guards the config key query_types_enabled_for_history_based_optimization.","triggerScenarios":"Setting query_types_enabled_for_history_based_optimization in features.properties (or setting the session property) to a value not exactly matching a QueryType enum name (SELECT, ANALYZE, ...), including typos, wrong case, or unsupported types like INSERT.","commonSituations":"Typo or lowercase query type in config file, copying a session property value that uses non-enum names, upgrading where the allowed set changed.","solutions":["Set the value to comma-separated QueryType enum names exactly as listed in the error message (e.g. SELECT,ANALYZE), uppercase, no invalid entries","Remove the config key to use defaults if HBO filtering is not needed","Check supported QueryType values for your Presto version before adding entries"],"exampleFix":"// before (features.properties)\nquery_types_enabled_for_history_based_optimization=select, insert\n// after\nquery_types_enabled_for_history_based_optimization=SELECT,ANALYZE","handlingStrategy":"validation","validationCode":"List<String> allowed = Arrays.stream(QueryType.values()).map(Enum::name).collect(toList());\nfor (String qt : Splitter.on(',').trimResults().omitEmptyStrings().split(configValue)) {\n    if (!allowed.contains(qt)) {\n        throw new IllegalArgumentException(\"Invalid query type: \" + qt + \"; allowed: \" + allowed);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    bootstrapConfig();\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == INVALID_SESSION_PROPERTY.toErrorCode().getCode()) {\n        throw new IllegalStateException(\"Fix query_types_enabled_for_history_based_optimization: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Use exact uppercase QueryType enum names in config","Validate features.properties values before deployment","Re-check allowed values after Presto upgrades"],"tags":["config","session-property","presto"],"backgroundTag":"invalid-config-value","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}