{"record":{"id":"e883758e34e14214","repo":"prestodb/presto","slug":"druid-deep-storage-error-e88375","errorCode":"DRUID_DEEP_STORAGE_ERROR","errorMessage":"Ingestion failed on ","messagePattern":"Ingestion failed on ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-druid/src/main/java/com/facebook/presto/druid/ingestion/DruidPageWriter.java","lineNumber":77,"sourceCode":"            FileSystem fileSystem = dataFile.getFileSystem(hadoopConfiguration);\n            try (FSDataOutputStream outputStream = fileSystem.create(dataFile);\n                    GZIPOutputStream zipOutputStream = new GZIPOutputStream(outputStream);\n                    JsonGenerator jsonGen = JSON_FACTORY.createGenerator(zipOutputStream)) {\n                for (int position = 0; position < page.getPositionCount(); position++) {\n                    jsonGen.writeStartObject();\n                    for (int channel = 0; channel < page.getChannelCount(); channel++) {\n                        DruidColumnInfo column = tableHandle.getColumns().get(channel);\n                        Block block = page.getBlock(channel);\n                        jsonGen.writeFieldName(column.getColumnName());\n                        writeFieldValue(jsonGen, column.getDataType(), block, position);\n                    }\n                    jsonGen.writeEndObject();\n                }\n            }\n            return dataFile;\n        }\n        catch (IOException e) {\n            throw new PrestoException(DRUID_DEEP_STORAGE_ERROR, \"Ingestion failed on \" + tableHandle.getTableName(), e);\n        }\n    }\n\n    private void writeFieldValue(JsonGenerator jsonGen, DruidColumnType dataType, Block block, int position)\n            throws IOException\n    {\n        switch (dataType) {\n            case VARCHAR:\n            case OTHER:\n                //hyperUnique, approxHistogram Druid column types\n                jsonGen.writeString(VARCHAR.getSlice(block, position).toStringUtf8());\n                return;\n            case BIGINT:\n            case TIMESTAMP:\n                jsonGen.writeNumber(BIGINT.getLong(block, position));\n                return;\n            case FLOAT:\n            case DOUBLE:","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-druid/src/main/java/com/facebook/presto/druid/ingestion/DruidPageWriter.java#L59-L95","documentation":"DruidPageWriter.append() serializes Presto page blocks into a JSON data file for Druid ingestion. If any IOException occurs while writing (file I/O, JSON generator failure, disk full), it wraps the cause in a PrestoException with code DRUID_DEEP_STORAGE_ERROR, naming the table whose ingestion failed.","triggerScenarios":"Calling DruidPageWriter.append() while writing page data to the local ingestion data file fails: disk full/permissions error on the data directory, IO error from the JsonGenerator while serializing field values, or the underlying output stream being closed unexpectedly mid-ingestion.","commonSituations":"Worker node disk full or read-only filesystem during Druid ingestion; permission denied on the staging/data directory; transient storage failure; serialization bugs on unusual column values causing the JSON generator to blow up mid-write.","solutions":["Check the wrapped cause (the PrestoException carries the IOException) and fix the root storage issue — free disk space, fix permissions, or remount the volume.","Verify the ingestion data directory configured for the page sink is writable by the Presto process.","Retry the ingestion after the storage problem is resolved; the failure aborts the whole write so data must be re-appended.","If serialization is failing on specific values, inspect the column data types against writeFieldValue's supported DruidColumnType handling."],"exampleFix":"// before\ntry (DruidPageWriter writer = new DruidPageWriter(tableHandle, ...)) {\n    writer.append(page); // IOException -> 'Ingestion failed on <table>'\n}\n\n// after (ensure storage headroom before ingesting)\nFile dataDir = new File(ingestionDataDir);\nif (dataDir.getUsableSpace() < requiredBytes) {\n    throw new PrestoException(NOT_ENOUGH_DISK_SPACE, \"Insufficient space for Druid ingestion: \" + dataDir);\n}\ntry (DruidPageWriter writer = new DruidPageWriter(tableHandle, ...)) {\n    writer.append(page);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["druid","ingestion","io","deep-storage"],"backgroundTag":"io-write-error","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"}