{"record":{"id":"2010b9c4fb0b0915","repo":"prestodb/presto","slug":"invalid-session-property-2010b9","errorCode":"INVALID_SESSION_PROPERTY","errorMessage":"Unable to parse session property: ","messagePattern":"Unable to parse session property: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java","lineNumber":856,"sourceCode":"        return t instanceof PrestoSparkFatalException;\n    }\n\n    @VisibleForTesting\n    static Session.SessionBuilder transferSessionPropertiesToSession(Session.SessionBuilder session, Map<String, String> sessionProperties)\n    {\n        sessionProperties.forEach((key, value) -> {\n            // Presto session properties may also contain catalog properties in format catalog.property_name=value\n            String[] parts = key.split(\"\\\\.\");\n            if (parts.length == 1) {\n                // system property\n                session.setSystemProperty(parts[0], value);\n            }\n            else if (parts.length == 2) {\n                // catalog property\n                session.setCatalogSessionProperty(parts[0], parts[1], value);\n            }\n            else {\n                throw new PrestoException(INVALID_SESSION_PROPERTY, \"Unable to parse session property: \" + key);\n            }\n        });\n\n        return session;\n    }\n}\n","sourceCodeStart":838,"sourceCodeEnd":863,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spark-base/src/main/java/com/facebook/presto/spark/PrestoSparkQueryExecutionFactory.java#L838-L863","documentation":"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.","triggerScenarios":"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.","commonSituations":"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'.","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"],"exampleFix":"// before (3-part ambiguous key)\nproperties.put(\"hive.bucket.exec_max_threads\", \"4\"); // ok, but \"hive.mydb.prop.x\" fails\n// after: valid catalog session property form\nproperties.put(\"hive.max_initial_split_size\", \"32MB\");\n// catalog session property: \"hive.mydb.prop\" (catalog= Catalog.property)","handlingStrategy":"validation","validationCode":"for (String key : sessionProperties.keySet()) {\n    String[] parts = key.split(\"\\\\.\");\n    boolean valid = parts.length == 1\n        || parts.length == 3                       // catalog.name.property\n        || (parts.length == 2);                    // catalog.property\n    if (!valid) throw new IllegalArgumentException(\"Invalid session property key: \" + key);\n}","typeGuard":"boolean isValidSessionPropertyKey(String key) {\n    if (key == null || key.isEmpty()) return false;\n    int parts = key.split(\"\\\\.\", -1).length;\n    return parts >= 1 && parts <= 3 && !key.contains(\"..\");\n}","tryCatchPattern":"try {\n    QueryExecution qe = factory.create(config);\n} catch (PrestoException e) {\n    if (\"INVALID_SESSION_PROPERTY\".equals(e.getErrorCode().getName())\n            && e.getMessage().startsWith(\"Unable to parse session property\")) {\n        // drop/rename the offending key and resubmit\n    } else throw e;\n}","preventionTips":["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"],"tags":["presto-spark","session-property","parsing"],"backgroundTag":"invalid-session-property","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"}