prestodb/presto · error · IllegalArgumentException
Invalid value [%s]. Valid values: %s
Error message
Invalid value [%s]. Valid values: %s
What it means
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.
Source
Thrown at presto-clickhouse/src/main/java/com/facebook/presto/plugin/clickhouse/ClickHouseTableProperties.java:151
public static <T extends Enum<T>> PropertyMetadata<T> enumProperty(String name, String descriptionPrefix, Class<T> type, T defaultValue, Consumer<T> validation, boolean hidden)
{
String allValues = EnumSet.allOf(type).stream()
.map(Enum::name)
.collect(joining(", ", "[", "]"));
return new PropertyMetadata<>(
name,
format("%s. Possible values: %s", descriptionPrefix, allValues),
VARCHAR,
type,
defaultValue,
hidden,
value -> {
T enumValue;
try {
enumValue = Enum.valueOf(type, ((String) value).toUpperCase(ENGLISH));
}
catch (IllegalArgumentException e) {
throw new IllegalArgumentException(format("Invalid value [%s]. Valid values: %s", value, allValues), e);
}
validation.accept(enumValue);
return enumValue;
},
Enum::name);
}
public static PropertyMetadata<String> stringProperty(String name, String description, String defaultValue, boolean hidden)
{
return stringProperty(name, description, defaultValue, value -> {}, hidden);
}
public static PropertyMetadata<String> stringProperty(String name, String description, String defaultValue, Consumer<String> validation, boolean hidden)
{
return new PropertyMetadata<>(
name,
description,
VARCHAR,
String.class,View on GitHub (pinned to 55bb57d202)
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
Example fix
// before CREATE TABLE ch.db.t (x int) WITH (engine = 'mergetree') // after CREATE TABLE ch.db.t (x int) WITH (engine = 'MergeTree')
Defensive patterns
Strategy: validation
Validate before calling
// Validate table property values against allowed enums before DDL
Set<String> validEngines = Set.of("MERGETREE", "REPLACEDMERGETREE", "REPLICATEDMERGETREE", "TINYLOG", "LOG");
String engine = props.getProperty("engine").toUpperCase(Locale.ENGLISH);
if (!validEngines.contains(engine)) {
throw new IllegalArgumentException("engine must be one of " + validEngines + ", got: " + engine);
} Type guard
boolean isValidEnumValue(Class<? extends Enum<?>> type, String v) {
try { Enum.valueOf(type, v.toUpperCase(Locale.ENGLISH)); return true; }
catch (IllegalArgumentException e) { return false; }
} Try / catch
try {
createTableWithProperties(...);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Invalid value [")) {
// surface valid values to the user / retry with corrected property
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Typos in engine/property names; lowercase or abbreviated values not in the enum; copying table definitions that use properties unsupported by this connector version.
Related errors
- INVALID_SESSION_PROPERTY
- INVALID_TABLE_PROPERTY
- iceberg.target-max-file-size must be at least 1 byte
- INVALID_SESSION_PROPERTY
- Invalid Kafka Offset start/end pair: %s - %s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/28416228eb7abab0.
Report an issue: GitHub.