{"record":{"id":"f6f0f339cbe7d1ef","repo":"prestodb/presto","slug":"iceberg-missing-data","errorCode":"ICEBERG_MISSING_DATA","errorMessage":"Error opening Iceberg split %s (offset=%s, length=%s): %s","messagePattern":"Error opening Iceberg split (.+?) \\(offset=(.+?), length=(.+?)\\): (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPageSourceProvider.java","lineNumber":443,"sourceCode":"        catch (Exception e) {\n            try {\n                if (dataSource != null) {\n                    dataSource.close();\n                }\n            }\n            catch (IOException ignored) {\n            }\n            if (e instanceof PrestoException) {\n                throw (PrestoException) e;\n            }\n            String message = format(\"Error opening Iceberg split %s (offset=%s, length=%s): %s\", path, start, length, e.getMessage());\n\n            if (e instanceof ParquetCorruptionException) {\n                throw new PrestoException(ICEBERG_BAD_DATA, message, e);\n            }\n\n            if (e instanceof BlockMissingException) {\n                throw new PrestoException(ICEBERG_MISSING_DATA, message, e);\n            }\n            throw new PrestoException(ICEBERG_CANNOT_OPEN_SPLIT, message, e);\n        }\n    }\n\n    public static Optional<org.apache.parquet.schema.Type> getColumnType(\n            Map<Integer, org.apache.parquet.schema.Type> parquetIdToField,\n            MessageType messageType,\n            IcebergColumnHandle column)\n    {\n        if (isPushedDownSubfield(column)) {\n            Subfield pushedDownSubfield = getPushedDownSubfield(column);\n            List<String> encodedPath = nestedColumnPath(pushedDownSubfield).stream()\n                    .map(AvroSchemaUtil::makeCompatibleName)\n                    .collect(Collectors.toList());\n            return getSubfieldType(messageType, AvroSchemaUtil.makeCompatibleName(pushedDownSubfield.getRootName()), encodedPath);\n        }\n","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergPageSourceProvider.java#L425-L461","documentation":"Same wrap point as ICEBERG_BAD_DATA but for BlockMissingException: while opening the Iceberg split's file, the underlying file system reported that a block required to read the file is missing. The connector rethrows it as PrestoException with code ICEBERG_MISSING_DATA, meaning the data file is incomplete or a storage block was lost — typically an HDFS missing-block situation. This is a data-loss condition, not a transient read error.","triggerScenarios":"createDataPageSource -> createParquetPageSource opening a split whose underlying distributed-file read throws BlockMissingException — e.g. the Parquet file on HDFS has under-replicated/deleted blocks, or the file was truncated/deleted after the split was planned.","commonSituations":"HDFS DataNode loss or disk failure losing blocks; a concurrent compaction/expiry job (e.g. Iceberg expireSnapshots or file deletion) removed files still referenced by a running query; under-replication after DataNode outage; manually deleted files in the table location.","solutions":["Run hdfs fsck on the reported path to identify missing blocks and restore them (e.g. from replication or backup); if unrecoverable, rewrite the affected data files.","Check whether a concurrent file-deletion job (expire_snapshots, orphan file cleanup, compaction) deleted files during the query; align cleanup retention with query durations and re-run the query after compaction completes.","Re-write the table or affected partitions from source data if blocks are permanently lost.","Verify no external process deletes files under the table directory outside of Iceberg metadata operations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Verify file health on HDFS before querying\nhdfs fsck /warehouse/db/table/data -files -blocks -locations\n# Ensure no expire_snapshots/cleanup job runs during query windows","typeGuard":null,"tryCatchPattern":"try {\n    queryResults = execute(\"SELECT * FROM iceberg_table\");\n} catch (PrestoException e) {\n    if (\"ICEBERG_MISSING_DATA\".equals(e.getErrorCode().getName())) {\n        // missing block: restore from fsck/backup or rewrite affected files\n        alertDataLoss(e); // do NOT blind-retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Keep HDFS replication factor >= 3 and monitor for under-replicated blocks.","Never delete data files outside Iceberg metadata operations.","Schedule expire_snapshots/orphan cleanup outside query windows and with retention > max query duration.","Alert on DataNode disk failures promptly."],"tags":["iceberg","missing-data","hdfs","block-missing","read-path"],"backgroundTag":"missing-block-data","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"}