{"record":{"id":"a4a8037f9894df5c","repo":"apache/beam","slug":"can-not-read-value-at-d-in-block-d-in-file-s","errorCode":null,"errorMessage":"Can not read value at %d in block %d in file %s","messagePattern":"Can not read value at (.+?) in block (.+?) in file (.+?)","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java","lineNumber":827,"sourceCode":"                  LOG.debug(\n                      \"record is filtered out by reader in block {} in file {}\",\n                      currentBlock,\n                      file.toString());\n                  continue;\n                }\n                if (recordReader.shouldSkipCurrentRecord()) {\n                  // this record is being filtered via the filter2 package\n                  LOG.debug(\n                      \"skipping record at {} in block {} in file {}\",\n                      currentRow,\n                      currentBlock,\n                      file.toString());\n                  continue;\n                }\n                outputReceiver.output(parseFn.apply(record));\n              } catch (RuntimeException e) {\n\n                throw new ParquetDecodingException(\n                    format(\n                        \"Can not read value at %d in block %d in file %s\",\n                        currentRow, currentBlock, file.toString()),\n                    e);\n              }\n            }\n            LOG.debug(\n                \"Finish processing {} rows from block {} in file {}\",\n                currentRow,\n                currentBlock - 1,\n                file.toString());\n          }\n        }\n      }\n\n      public Configuration getConfWithModelClass() throws ReflectiveOperationException {\n        Configuration conf = SerializableConfiguration.newConfiguration(configuration);\n        GenericData model = buildModelObject(modelClass);","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/parquet/src/main/java/org/apache/beam/sdk/io/parquet/ParquetIO.java#L809-L845","documentation":"ParquetIO.ReadFiles wraps any RuntimeException thrown while decoding a Parquet record into a ParquetDecodingException with the row, block, and file coordinates. It means the file contains a record that could not be parsed with the configured Avro schema/function, not that the file itself is unreadable.","triggerScenarios":"Calling ParquetIO.readFiles(schema) and the pipeline hits a row whose decode via parseFn (e.g. GenericRecord-to-Avro conversion) throws a RuntimeException.","commonSituations":"Schema mismatch between the read schema and the file's actual schema; corrupted parquet files; custom parse functions throwing on unexpected field values (nulls, incompatible unions).","solutions":["Verify the Avro schema passed to ParquetIO.readFiles matches the writer schema of the file (use the file's own schema via AvroParquetReader.getSchema).","Inspect the file at the reported row/block with parquet-tools / parquet cat to find the malformed record.","Wrap your parseFn logic defensively so problematic records are logged/skipped instead of thrown.","Re-export or regenerate the source parquet file if it is corrupt."],"exampleFix":"// before\nParquetIO.readFiles(schema).withParseFn(parseFn);\n// after\nParquetIO.readFiles(file.getSchema()).withParseFn(safeParseFn); // safeParseFn returns null/logs on bad records","handlingStrategy":"try-catch","validationCode":"// Pre-validate file vs schema\nSchema parserSchema = schema; // Avro schema passed to readFiles\nSchema fileSchema = AvroParquetReader.builder(parserSchema).build(new Path(file)).getSchema();\nif (!fileSchema.equals(parserSchema)) { log.warn(\"schema mismatch for \" + file); }","typeGuard":null,"tryCatchPattern":"// ParquetIO throws ParquetDecodingException wrapping the cause\ntry {\n  pipeline.apply(ParquetIO.readFiles(schema));\n} catch (ParquetDecodingException e) {\n  log.error(\"decode failed at row {} block {} file {}\", e); // inspect e.getCause()\n}","preventionTips":["Always derive the read schema from the parquet files' writer schema.","Make parseFn total: handle nulls/unknown unions without throwing.","Validate parquet files with parquet-tools before ingesting."],"tags":["parquet","decoding","apache-beam","java-io"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}