{"record":{"id":"ae1344085c9e0dd5","repo":"apache/iceberg","slug":"failed-to-open-parquet-file-s","errorCode":null,"errorMessage":"Failed to open Parquet file: %s","messagePattern":"Failed to open Parquet file: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java","lineNumber":196,"sourceCode":"  }\n\n  Integer batchSize() {\n    return batchSize;\n  }\n\n  List<Map<ColumnPath, ColumnChunkMetaData>> columnChunkMetadataForRowGroups() {\n    return columnChunkMetaDataForRowGroups;\n  }\n\n  ReadConf<T> copy() {\n    return new ReadConf<>(this);\n  }\n\n  private static ParquetFileReader newReader(InputFile file, ParquetReadOptions options) {\n    try {\n      return ParquetFileReader.open(ParquetIO.file(file), options);\n    } catch (IOException e) {\n      throw new RuntimeIOException(e, \"Failed to open Parquet file: %s\", file.location());\n    }\n  }\n\n  private List<Map<ColumnPath, ColumnChunkMetaData>> getColumnChunkMetadataForRowGroups() {\n    Set<ColumnPath> projectedColumns =\n        projection.getColumns().stream()\n            .map(columnDescriptor -> ColumnPath.get(columnDescriptor.getPath()))\n            .collect(Collectors.toSet());\n    ImmutableList.Builder<Map<ColumnPath, ColumnChunkMetaData>> listBuilder =\n        ImmutableList.builder();\n    for (int i = 0; i < rowGroups.size(); i++) {\n      if (!shouldSkip[i]) {\n        BlockMetaData blockMetaData = rowGroups.get(i);\n        ImmutableMap.Builder<ColumnPath, ColumnChunkMetaData> mapBuilder = ImmutableMap.builder();\n        blockMetaData.getColumns().stream()\n            .filter(columnChunkMetaData -> projectedColumns.contains(columnChunkMetaData.getPath()))\n            .forEach(\n                columnChunkMetaData ->","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java#L178-L214","documentation":"ReadConf (the read-planning configuration for a Parquet scan) opens the data file with ParquetFileReader to read footer/metadata; if opening the file throws IOException it is rethrown as RuntimeIOException including the file location. This means the file could not be opened or its footer could not be read at all — most often the file is missing, unreadable, or not a valid Parquet file.","triggerScenarios":"Constructing a Parquet reader/ReadConf for a data file whose location cannot be opened by ParquetFileReader.open(ParquetIO.file(file), options) — nonexistent path, missing permissions, truncated/corrupt file, or invalid footer magic.","commonSituations":"Stale metadata pointing at deleted files (missing snapshot files); incorrect warehouse/filesystem configuration (wrong S3 bucket or HDFS path); partially-written files from a failed job; credentials lacking read access; file written by an incompatible Parquet version.","solutions":["Check the file location in the message exists and is reachable with the configured FileIO/credentials","Verify table metadata is not stale — run expire/remove orphan procedures if the file was deleted","Confirm the file is a complete, valid Parquet file (footer present; not truncated by a failed write)","Fix filesystem configuration (endpoint, bucket, HDFS core-site settings) in the read job","If the file is corrupt, re-write the affected data files from a valid snapshot or re-ingest"],"exampleFix":"// before: scan fails on a deleted file referenced by old metadata\nCloseableIterable<Record> rows = Parquet.read(file).project(schema).build();\n\n// after: check existence and fail with an actionable message before planning\nif (!io.newInputFile(file.location()).exists()) {\n  throw new FileNotFoundException(\"Data file missing from storage: \" + file.location());\n}\nCloseableIterable<Record> rows = Parquet.read(file).project(schema).build();","handlingStrategy":"validation","validationCode":"if (!io.newInputFile(location).exists()) {\n  throw new FileNotFoundException(\"Data file missing: \" + location);\n}","typeGuard":null,"tryCatchPattern":"try { return Parquet.read(file).project(schema).build(); } catch (RuntimeIOException e) { LOG.error(\"Cannot open {}: {}\", file.location(), e.getCause().getMessage()); throw e; }","preventionTips":["Verify data files exist before scanning; run remove_orphan_files/expire_snapshots housekeeping","Check filesystem configuration (endpoints, buckets, core-site) matches where data was written","Confirm credentials grant read access to the data location","Treat this error on a specific file as corruption/truncation — re-ingest or rewrite that file"],"tags":["parquet","io","file-not-found","scan-planning"],"backgroundTag":"file-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}