{"record":{"id":"b9030cbb54b03a33","repo":"prestodb/presto","slug":"lance-error-b9030c","errorCode":"LANCE_ERROR","errorMessage":"lance.root must be set when using lance.impl=dir","messagePattern":"lance\\.root must be set when using lance\\.impl=dir","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-lance/src/main/java/com/facebook/presto/lance/LanceNamespaceHolder.java","lineNumber":131,"sourceCode":"        // Parse namespace properties from catalog config\n        String impl = config.getImpl();\n        Map<String, String> properties = new HashMap<>();\n        Map<String, String> storageOpts = new HashMap<>();\n        for (Map.Entry<String, String> entry : namespaceProperties.entrySet()) {\n            String key = entry.getKey();\n            if (key.startsWith(\"lance.\")) {\n                String strippedKey = key.substring(6);\n                properties.put(strippedKey, entry.getValue());\n                if (strippedKey.startsWith(\"storage.\")) {\n                    storageOpts.put(strippedKey.substring(8), entry.getValue());\n                }\n            }\n        }\n        this.namespaceStorageOptions = ImmutableMap.copyOf(storageOpts);\n\n        // Validate that 'root' is set for directory namespace\n        if (\"dir\".equals(impl) && !properties.containsKey(\"root\")) {\n            throw new PrestoException(LanceErrorCode.LANCE_ERROR,\n                    \"lance.root must be set when using lance.impl=dir\");\n        }\n\n        // For DirectoryNamespace, ensure default settings are applied\n        if (\"dir\".equals(impl)) {\n            properties.putIfAbsent(\"manifest_enabled\", \"true\");\n            properties.putIfAbsent(\"dir_listing_enabled\", \"true\");\n        }\n\n        // Initialize namespace\n        this.namespace = LanceNamespace.connect(impl, properties, allocator);\n\n        // Initialize namespace level handling\n        this.singleLevelNs = config.isSingleLevelNs();\n        String parent = config.getParent();\n        if (parent != null && !parent.isEmpty()) {\n            // Parent uses '$' as delimiter to avoid conflicts with common path separators ('/' and '.')\n            // and namespace-level separators. Example: \"org$warehouse\" -> [\"org\", \"warehouse\"]","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lance/src/main/java/com/facebook/presto/lance/LanceNamespaceHolder.java#L113-L149","documentation":"Configuration guard in LanceNamespaceHolder: the catalog was configured with lance.impl=dir (directory-backed namespace) but no lance.root property was supplied, so there is no root directory under which to resolve namespaces and datasets.","triggerScenarios":"Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LanceNamespaceHolder.java:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set lance.root in the catalog properties to the directory that holds the Lance datasets","Or switch lance.impl to a managed-namespace implementation that does not require a local root"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}