{"record":{"id":"92f97a51f986d157","repo":"prestodb/presto","slug":"invalid-session-property-92f97a","errorCode":"INVALID_SESSION_PROPERTY","errorMessage":"%s must be non-null","messagePattern":"(.+?) must be non-null","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java","lineNumber":581,"sourceCode":"                        NATIVE_RPC_RATELIMITER_MAX_LIMIT,\n                        \"Native Execution only. Ceiling for the per-tier RPC rate-limiter max-pending \" +\n                                \"cap. Default 200 (validated for LLM-inference backends); 0 falls back to \" +\n                                \"the built-in 20. Admission-controlled dispatch makes this cap bind; the \" +\n                                \"adaptive limiter shrinks from here under overload.\",\n                        200L,\n                        !nativeExecution),\n                longProperty(\n                        NATIVE_RPC_CONGESTION_MAX_WINDOW,\n                        \"Native Execution only. Ceiling for the per-driver RPC congestion window \" +\n                                \"(0 = per-mode default: PER_ROW 100, BATCH 256).\",\n                        0L,\n                        !nativeExecution));\n    }\n\n    private static Integer validateIntegerRange(Object value, String property, int lowerBoundIncluded, int upperBoundIncluded)\n    {\n        if (value == null) {\n            throw new PrestoException(INVALID_SESSION_PROPERTY, format(\"%s must be non-null\", property));\n        }\n\n        int intValue = ((Number) value).intValue();\n        if (intValue < lowerBoundIncluded || intValue > upperBoundIncluded) {\n            throw new PrestoException(\n                    INVALID_SESSION_PROPERTY,\n                    format(\"%s must be between %s and %s: %s\", property, lowerBoundIncluded, upperBoundIncluded, intValue));\n        }\n        return intValue;\n    }\n\n    @Override\n    public List<PropertyMetadata<?>> getSessionProperties()\n    {\n        return sessionProperties;\n    }\n}\n","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java#L563-L599","documentation":"Thrown by NativeWorkerSessionPropertyProvider.validateIntegerRange when a native-execution integer session property is supplied as null. The provider validates every session property value against its declared type and range before passing it to native workers; null is rejected outright because there is no meaningful default at this layer.","triggerScenarios":"Calling getSessionProperties/system session property APIs with an explicit null value for an integer property (e.g. via SET SESSION x = NULL through JDBC/CLI, or a coordinator plugin passing null in the session properties map).","commonSituations":"Client drivers or BI tools binding a null parameter into SET SESSION; scripted query submission templating where a property value is empty and becomes null; connectors/plugins building session properties programmatically without null checks.","solutions":["Supply a concrete integer value for the session property instead of null","Remove the SET SESSION clause so the property falls back to its system default","Check client-side why a null was bound (empty template variable, unset config) and fix the source","If building properties in code, skip null values rather than adding them to the map"],"exampleFix":"// before\nsession.setAttribute(\"native_worker_property\", null);\n// after\nInteger value = config.getProperty(\"native_worker_property\", 1024);\nsession.setAttribute(\"native_worker_property\", value);","handlingStrategy":"validation","validationCode":"Object value = sessionPropertyMap.get(propertyName);\nif (value == null) {\n    throw new IllegalArgumentException(propertyName + \" must be non-null\");\n}\nif (!(value instanceof Number)) {\n    throw new IllegalArgumentException(propertyName + \" must be a number\");\n}","typeGuard":"boolean isValidIntegerProperty(Object value) {\n    return value instanceof Number && ((Number) value).intValue() != 0 || value instanceof Integer;\n}","tryCatchPattern":null,"preventionTips":["Never bind null into SET SESSION parameters; use defaults instead","Skip null entries when programmatically assembling session properties","Guard template-driven query scripts against empty/unset variables","Validate property values client-side before submission"],"tags":["presto","session-properties","validation","null-value"],"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"}