{"record":{"id":"e5fc42a14e82d446","repo":"apache/seatunnel","slug":"failed-to-create-empty-dataset-at","errorCode":null,"errorMessage":"Failed to create empty dataset at ","messagePattern":"Failed to create empty dataset at ","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java","lineNumber":296,"sourceCode":"                        }\n\n                        Schema schemaWithMetadata = new Schema(arrowSchema.getFields(), metadata);\n\n                        org.apache.arrow.memory.BufferAllocator allocator =\n                                new org.apache.arrow.memory.RootAllocator();\n                        try {\n                            com.lancedb.lance.WriteParams writeParams =\n                                    new com.lancedb.lance.WriteParams.Builder().build();\n                            com.lancedb.lance.Dataset.create(\n                                    allocator, datasetPath, schemaWithMetadata, writeParams);\n                            log.debug(\"Created empty dataset at {}\", datasetPath);\n                        } finally {\n                            allocator.close();\n                        }\n                    }\n                }\n            } catch (Exception e) {\n                throw new CatalogException(\"Failed to create empty dataset at \" + datasetPath, e);\n            }\n        }\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {\n        DropTableRequest request = new DropTableRequest();\n        List<String> ids = Lists.newArrayList(tablePath.getTableName());\n        request.setId(ids);\n        try {\n            namespace.dropTable(request);\n        } catch (Exception e) {\n            String errorMsg = e.getMessage();\n            if (errorMsg != null\n                    && (errorMsg.contains(\"Table does not exist\")\n                            || errorMsg.contains(\"TABLE_NOT_FOUND\")\n                            || errorMsg.contains(\"404\")","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/catalog/LanceCatalog.java#L278-L314","documentation":"LanceCatalog.createTable, when creating an empty dataset, wraps any exception from the dataset-creation flow (Arrow schema serialization, allocator usage, dataset write) into a CatalogException 'Failed to create empty dataset at <path>'. It indicates the empty Lance dataset could not be materialized at the target path.","triggerScenarios":"createTable is invoked with an empty initial schema (ignoreIfExists false) and the underlying write to datasetPath throws — e.g. storage failure, invalid schema, or allocator/deserializer errors.","commonSituations":"Warehouse path not writable or doesn't exist and cannot be created; object storage misconfigured (bad endpoint/credentials); schema passed to createTable is invalid for Lance; disk full.","solutions":["Check the cause exception for the underlying storage or schema error","Verify the warehouse/dataset path is writable and credentials are correct","Validate the CatalogTable schema is compatible with Lance types before creating","Ensure the target path does not contain a conflicting partial dataset from a previous failed create"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Path p = Paths.get(datasetPath);\nif (Files.exists(p) && !Files.isWritable(p)) {\n    throw new IllegalStateException(\"Dataset path not writable: \" + datasetPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n    lanceCatalog.createTable(tablePath, catalogTable, false);\n} catch (CatalogException e) {\n    // inspect cause: storage access, schema validity, or partial dataset\n}","preventionTips":[],"tags":["lance","catalog","file-write-failed"],"backgroundTag":"file-write-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}