{"record":{"id":"78e991abb4bb4098","repo":"apache/iceberg","slug":"unsupported-nested-type-datatype","errorCode":null,"errorMessage":"Unsupported nested type: ${dataType()}","messagePattern":"Unsupported nested type: (.+?)","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorWithFilter.java","lineNumber":147,"sourceCode":"\n  @Override\n  public byte[] getBinary(int rowId) {\n    return delegate.getBinary(rowIdMapping[rowId]);\n  }\n\n  @Override\n  public ColumnVector getChild(int ordinal) {\n    if (children == null) {\n      synchronized (this) {\n        if (children == null) {\n          if (dataType() instanceof StructType) {\n            StructType structType = (StructType) dataType();\n            this.children = new ColumnVectorWithFilter[structType.length()];\n            for (int index = 0; index < structType.length(); index++) {\n              children[index] = new ColumnVectorWithFilter(delegate.getChild(index), rowIdMapping);\n            }\n          } else {\n            throw new UnsupportedOperationException(\"Unsupported nested type: \" + dataType());\n          }\n        }\n      }\n    }\n\n    return children[ordinal];\n  }\n}\n","sourceCodeStart":129,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorWithFilter.java#L129-L156","documentation":"ColumnVectorWithFilter wraps a column vector to apply a row-id selection (filtered batch reads). Its getChild lazily wraps child vectors for nested columns; it supports only array/map (via delegate), and struct children by rebuilding child ColumnVectorWithFilter instances. If the wrapped vector's data type is neither of those, it throws UnsupportedOperationException because filtered access to that nested type is not implemented.","triggerScenarios":"A vectorized Spark read with row-level filters (delete files / positional deletes producing a rowIdMapping) where a requested child column's parent type is a nested type other than struct/array/map — e.g. filtered access into a nested column of an unsupported container.","commonSituations":"Reading tables with delete files where the query projects nested fields of an exotic type; newer Spark versions introducing a nested ColumnVector type this wrapper doesn't handle; version skew between Spark and the Iceberg Spark runtime.","solutions":["Upgrade the Iceberg Spark runtime to match your Spark version so nested filtered reads are supported","Rewrite the query to avoid projecting the unsupported nested column (or read it without the filter)","Compact/rewrite data files to remove delete files so the plain (non-filtered) vector path is used","Disable vectorization: spark.sql.iceberg.vectorization.enabled=false","Set iceberg.engine.filters.enabled=false to avoid the filtered column-vector path"],"exampleFix":"// before: spark.conf.set(\"spark.sql.iceberg.vectorization.enabled\",\"true\") with deletes on nested columns\n// after:\nspark.conf.set(\"spark.sql.iceberg.vectorization.enabled\", \"false\") // or rewrite files to clear deletes","handlingStrategy":"try-catch","validationCode":"// Check whether the scan will use the filtered vector path (delete files present)\nTable table = sparkAdapter; // or:\n// spark.sql(\"SELECT * FROM tbl.refs\"); // inspect snapshots for delete files before nested projections","typeGuard":null,"tryCatchPattern":"try {\n  df.select(\"nested.field\").collect();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported nested type:\")) {\n    spark.conf.set(\"spark.sql.iceberg.vectorization.enabled\", \"false\"); // retry unvectorized\n  } else throw e;\n}","preventionTips":["Keep the Iceberg Spark runtime matched to the exact Spark minor version","Periodically rewrite tables to remove delete files","Avoid projecting deeply nested columns in queries over tables with pending deletes; flatten schemas where possible"],"tags":["spark","vectorized-read","nested-types","deletes"],"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"}