{"record":{"id":"39e4ba977568bf63","repo":"apache/iceberg","slug":"format-not-supported-for-batched-reads","errorCode":null,"errorMessage":"Format:  not supported for batched reads","messagePattern":"Format:  not supported for batched reads","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java","lineNumber":345,"sourceCode":"            FormatModelRegistry.readBuilder(FileFormat.PARQUET, ColumnarBatch.class, location);\n\n        if (reuseContainers) {\n          builder.reuseContainers();\n        }\n        if (nameMapping != null) {\n          builder.withNameMapping(NameMappingParser.fromJson(nameMapping));\n        }\n\n        iter =\n            builder\n                .project(expectedSchema)\n                .split(task.start(), task.length())\n                .recordsPerBatch(batchSize)\n                .caseSensitive(caseSensitive)\n                .filter(task.residual())\n                .build();\n      } else {\n        throw new UnsupportedOperationException(\n            \"Format: \" + task.file().format() + \" not supported for batched reads\");\n      }\n      return iter.iterator();\n    }\n\n    @Override\n    public void close() throws IOException {\n      // close the current iterator\n      this.currentIterator.close();\n\n      // exhaust the task iterator\n      while (fileItr.hasNext()) {\n        fileItr.next();\n      }\n    }\n\n    private InputFile getInputFile(FileScanTask task) {\n      Preconditions.checkArgument(!task.isDataTask(), \"Invalid task type\");","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java#L327-L363","documentation":"Thrown by ArrowReader.open when a FileScanTask's data file format is not Parquet, the only format the batched (vectorized) reader supports. ORC, Avro, and other formats have no Arrow RecordBatch read path, so the vectorized reader refuses them explicitly.","triggerScenarios":"Enabling batched/vectorized reads on a table containing ORC or Avro data files; mixed-format tables where some tasks point at non-Parquet files; writing data with write.format.default=orc/avro then reading with vectorization enabled.","commonSituations":"Tables migrated from other engines that use ORC; tables where format.default was changed to Avro; mixed-format tables after a format migration where old files remain.","solutions":["Rewrite the table data files to Parquet (e.g. rewrite_data_files procedure/action) so all tasks use the supported format.","Disable vectorized/batched reads to fall back to the row-oriented reader that supports ORC/Avro.","Set write.format.default=parquet for future writes and exclude non-Parquet files from vectorized scans."],"exampleFix":"// before\nconf.set(\"spark.sql.iceberg.vectorization.enabled\", \"true\"); // table is ORC\n// after\nconf.set(\"spark.sql.iceberg.vectorization.enabled\", \"false\");\n// or rewrite: CALL catalog.system.rewrite_data_files(table => 'db.tbl')","handlingStrategy":"validation","validationCode":"if (task.file().format() != FileFormat.PARQUET) {\n  // route to row-based reader or rewrite file\n}","typeGuard":null,"tryCatchPattern":"try {\n  return arrowReader.open(task);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"not supported for batched reads\")) {\n    return rowBasedReader.open(task);\n  }\n  throw e;\n}","preventionTips":["Standardize tables on Parquet (write.format.default=parquet) before enabling vectorization.","Audit mixed-format tables for leftover ORC/Avro files and rewrite them (rewrite_data_files).","Gate vectorized reads per-file-format in custom engine integrations."],"tags":["arrow","file-format","vectorized-read","parquet"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}