{"record":{"id":"95a85b9e4ff7fc57","repo":"apache/iceberg","slug":"cannot-read-unsupported-column-types","errorCode":null,"errorMessage":"Cannot read unsupported column types: ","messagePattern":"Cannot read unsupported column types: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java","lineNumber":257,"sourceCode":"\n      if (fileTasks.stream().anyMatch(TableScanUtil::hasDeletes)) {\n        throw new UnsupportedOperationException(\n            \"Cannot read files that require applying delete files\");\n      }\n\n      if (expectedSchema.columns().isEmpty()) {\n        throw new UnsupportedOperationException(\n            \"Cannot read without at least one projected column\");\n      }\n\n      Set<TypeID> unsupportedTypes =\n          Sets.difference(\n              expectedSchema.columns().stream()\n                  .map(c -> c.type().typeId())\n                  .collect(Collectors.toSet()),\n              SUPPORTED_TYPES);\n      if (!unsupportedTypes.isEmpty()) {\n        throw new UnsupportedOperationException(\n            \"Cannot read unsupported column types: \" + unsupportedTypes);\n      }\n\n      Map<String, ByteBuffer> keyMetadata = Maps.newHashMap();\n      fileTasks.stream()\n          .map(FileScanTask::file)\n          .forEach(file -> keyMetadata.put(file.location(), file.keyMetadata()));\n\n      Stream<EncryptedInputFile> encrypted =\n          keyMetadata.entrySet().stream()\n              .map(\n                  entry ->\n                      EncryptedFiles.encryptedInput(\n                          io.newInputFile(entry.getKey()), entry.getValue()));\n\n      // decrypt with the batch call to avoid multiple RPCs to a key server, if possible\n      @SuppressWarnings(\"StreamToIterable\")\n      Iterable<InputFile> decryptedFiles = encryptionManager.decrypt(encrypted::iterator);","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java#L239-L275","documentation":"Thrown by VectorizedCombinedScanIterator when the expected table schema contains column types that the vectorized (Arrow batch) reader cannot decode. The vectorized reader supports a fixed set of Iceberg types (its SUPPORTED_TYPES set); anything outside it aborts the scan instead of silently degrading. This is a fail-fast guard before any batches are produced.","triggerScenarios":"Calling a vectorized/batch read path (e.g. Spark's vectorized reader or ArrowReader.open) on a table whose expected schema resolves to a type not in SUPPORTED_TYPES — e.g. timestamp-with-zone offsets in old versions, unknown/newer Iceberg types, or projected nested types the reader does not handle.","commonSituations":"Reading a table written by a newer Iceberg version whose types the consuming build's vectorized reader does not know; enabling vectorized reads (spark.sql.iceberg.handle-timestamp-without-timezone / vectorization.enabled style configs) on schemas with exotic types; projecting columns that fall back to unsupported typeIds.","solutions":["Disable vectorized reads for this scan so the row-based reader is used (e.g. set the reader/vectorization-enabled option to false in Spark: SET spark.sql.iceberg.vectorization.enabled=false).","Check which typeIds are unsupported (the message lists them) and either drop them from the projection or cast them to supported types in the query.","Upgrade Iceberg (and Spark integration) to a version whose SUPPORTED_TYPES includes the column types in the table.","If the type is genuinely new, extend SUPPORTED_TYPES and the corresponding vectorized readers in arrow/src/main/java/org/apache/iceberg/arrow/vectorized/."],"exampleFix":"// before (Spark)\nspark.read.format(\"iceberg\").load(\"db.tbl\") // vectorized reader aborts on unsupported type\n// after\nspark.conf.set(\"spark.sql.iceberg.vectorization.enabled\", \"false\")\nspark.read.format(\"iceberg\").load(\"db.tbl\")","handlingStrategy":"validation","validationCode":"import org.apache.iceberg.types.Types;\nimport org.apache.iceberg.arrow.vectorized.VectorizedArrowReader;\nimport java.util.Set;\nimport java.util.stream.Collectors;\nSet<Types.TypeID> unsupported = expectedSchema.columns().stream()\n    .map(c -> c.type().typeId())\n    .filter(id -> !VectorizedArrowReader.SUPPORTED_TYPES.contains(id))\n    .collect(Collectors.toSet());\nif (!unsupported.isEmpty()) {\n  // fall back to non-vectorized read\n}","typeGuard":null,"tryCatchPattern":"try (CloseableIterator<ColumnarBatch> it = batches) {\n  while (it.hasNext()) { consume(it.next()); }\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Cannot read unsupported column types\")) {\n    fallbackToRowBasedReader();\n  } else { throw e; }\n}","preventionTips":["Before enabling vectorized reads, verify the table schema against the reader's supported types for your Iceberg version.","Keep Iceberg upgraded when using newer logical types.","Filter or cast unsupported columns out of the projection before vectorized scans.","Add a config guard in job setup that disables vectorization when unsupported typeIds are present."],"tags":["arrow","vectorized-read","unsupported-type","schema"],"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"}