prestodb/presto · error · PrestoException
INVALID_SESSION_PROPERTY
INVALID_SESSION_PROPERTY
Error message
Unable to parse session property:
What it means
PrestoSparkQueryExecutionFactory parses submitted session property keys: system properties ('x=y', 1 part), catalog properties ('catalog.prop=value', 3 parts), and catalog session properties ('catalog.name=value', 2 parts). A key that splits into an unexpected number of dot-separated parts cannot be mapped to any of these and throws INVALID_SESSION_PROPERTY.
Source
Thrown at presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java:856
return t instanceof PrestoSparkFatalException;
}
@VisibleForTesting
static Session.SessionBuilder transferSessionPropertiesToSession(Session.SessionBuilder session, Map<String, String> sessionProperties)
{
sessionProperties.forEach((key, value) -> {
// Presto session properties may also contain catalog properties in format catalog.property_name=value
String[] parts = key.split("\\.");
if (parts.length == 1) {
// system property
session.setSystemProperty(parts[0], value);
}
else if (parts.length == 2) {
// catalog property
session.setCatalogSessionProperty(parts[0], parts[1], value);
}
else {
throw new PrestoException(INVALID_SESSION_PROPERTY, "Unable to parse session property: " + key);
}
});
return session;
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Format the key as 'catalog.propertyName' for catalog session properties or use a plain system property name without a catalog prefix
- Remove or rename keys with more than two dot-separated segments before submission
- Check the client SDK/API docs for how session properties are encoded when launching Presto on Spark queries
Example fix
// before (3-part ambiguous key)
properties.put("hive.bucket.exec_max_threads", "4"); // ok, but "hive.mydb.prop.x" fails
// after: valid catalog session property form
properties.put("hive.max_initial_split_size", "32MB");
// catalog session property: "hive.mydb.prop" (catalog= Catalog.property) Defensive patterns
Strategy: validation
Validate before calling
for (String key : sessionProperties.keySet()) {
String[] parts = key.split("\\.");
boolean valid = parts.length == 1
|| parts.length == 3 // catalog.name.property
|| (parts.length == 2); // catalog.property
if (!valid) throw new IllegalArgumentException("Invalid session property key: " + key);
} Type guard
boolean isValidSessionPropertyKey(String key) {
if (key == null || key.isEmpty()) return false;
int parts = key.split("\\.", -1).length;
return parts >= 1 && parts <= 3 && !key.contains("..");
} Try / catch
try {
QueryExecution qe = factory.create(config);
} catch (PrestoException e) {
if ("INVALID_SESSION_PROPERTY".equals(e.getErrorCode().getName())
&& e.getMessage().startsWith("Unable to parse session property")) {
// drop/rename the offending key and resubmit
} else throw e;
} Prevention
- Use 'catalog.property' for catalog session properties and plain names for system properties
- Reject session property keys with more than three dot segments at submission time
- Sanitize forwarded keys from generic properties files before launching Spark queries
- Add a unit test covering the 1/2/3-part key forms your pipeline produces
When it happens
Trigger: Submitting a Spark query whose session config contains a property key that is neither a plain system property nor of the form 'catalog.property' or 'catalog.name.property' — e.g. an empty key, a key with two dots like 'catalog.name.extra.prop', or a misplaced dot.
Common situations: Setting catalog session properties with wrong syntax (extra dot segment); forwarding arbitrary Spark/Hadoop-style dotted keys as session properties; typos like 'db.catalog..prop'.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- INVALID_SESSION_PROPERTY
- INVALID_FUNCTION_ARGUMENT
- Invalid day-time interval:
- Invalid year-month interval:
- QualifiedObjectName should have exactly 3 parts, found %s: %
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/2010b9c4fb0b0915.
Report an issue: GitHub.