{"record":{"id":"28416228eb7abab0","repo":"prestodb/presto","slug":"invalid-value-s-valid-values-s","errorCode":null,"errorMessage":"Invalid value [%s]. Valid values: %s","messagePattern":"Invalid value \\[(.+?)\\]\\. Valid values: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseTableProperties.java","lineNumber":151,"sourceCode":"    public static <T extends Enum<T>> PropertyMetadata<T> enumProperty(String name, String descriptionPrefix, Class<T> type, T defaultValue, Consumer<T> validation, boolean hidden)\n    {\n        String allValues = EnumSet.allOf(type).stream()\n                .map(Enum::name)\n                .collect(joining(\", \", \"[\", \"]\"));\n        return new PropertyMetadata<>(\n                name,\n                format(\"%s. Possible values: %s\", descriptionPrefix, allValues),\n                VARCHAR,\n                type,\n                defaultValue,\n                hidden,\n                value -> {\n                    T enumValue;\n                    try {\n                        enumValue = Enum.valueOf(type, ((String) value).toUpperCase(ENGLISH));\n                    }\n                    catch (IllegalArgumentException e) {\n                        throw new IllegalArgumentException(format(\"Invalid value [%s]. Valid values: %s\", value, allValues), e);\n                    }\n                    validation.accept(enumValue);\n                    return enumValue;\n                },\n                Enum::name);\n    }\n    public static PropertyMetadata<String> stringProperty(String name, String description, String defaultValue, boolean hidden)\n    {\n        return stringProperty(name, description, defaultValue, value -> {}, hidden);\n    }\n\n    public static PropertyMetadata<String> stringProperty(String name, String description, String defaultValue, Consumer<String> validation, boolean hidden)\n    {\n        return new PropertyMetadata<>(\n                name,\n                description,\n                VARCHAR,\n                String.class,","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseTableProperties.java#L133-L169","documentation":"ClickHouseTableProperties.enumProperty builds a table-property converter that parses a string into an enum by upper-casing it and calling Enum.valueOf. If the provided value is not a valid enum constant it throws IllegalArgumentException with the list of valid values. It is a table-property validation error thrown at planning time.","triggerScenarios":"Specifying an invalid value for a ClickHouse table property (e.g. an unknown engine name in WITH (engine = '...')) in CREATE TABLE or CREATE TABLE AS through the ClickHouse catalog.","commonSituations":"Typos in engine/property names; lowercase or abbreviated values not in the enum; copying table definitions that use properties unsupported by this connector version.","solutions":["Use one of the valid values listed in the error message","Check the connector docs for supported table properties (e.g. engine values)","Remove the property to accept the default","Upgrade the connector if you need a newer property value"],"exampleFix":"// before\nCREATE TABLE ch.db.t (x int) WITH (engine = 'mergetree')\n// after\nCREATE TABLE ch.db.t (x int) WITH (engine = 'MergeTree')","handlingStrategy":"validation","validationCode":"// Validate table property values against allowed enums before DDL\nSet<String> validEngines = Set.of(\"MERGETREE\", \"REPLACEDMERGETREE\", \"REPLICATEDMERGETREE\", \"TINYLOG\", \"LOG\");\nString engine = props.getProperty(\"engine\").toUpperCase(Locale.ENGLISH);\nif (!validEngines.contains(engine)) {\n    throw new IllegalArgumentException(\"engine must be one of \" + validEngines + \", got: \" + engine);\n}","typeGuard":"boolean isValidEnumValue(Class<? extends Enum<?>> type, String v) {\n    try { Enum.valueOf(type, v.toUpperCase(Locale.ENGLISH)); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    createTableWithProperties(...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid value [\")) {\n        // surface valid values to the user / retry with corrected property\n    } else throw e;\n}","preventionTips":["Copy property values from connector docs verbatim","Uppercase engine names (Enum.valueOf is case-sensitive after toUpperCase)","Validate table properties in migration tooling before executing DDL","List supported properties per connector version"],"tags":["configuration","table-properties","validation","enum"],"backgroundTag":"invalid-prop-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"}