{"record":{"id":"eb44df5437a4d5ae","repo":"apache/iceberg","slug":"unknown-dummy-vector-holder-holder-eb44df","errorCode":null,"errorMessage":"Unknown dummy vector holder: ${holder}","messagePattern":"Unknown dummy vector holder: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorBuilder.java","lineNumber":41,"sourceCode":"import org.apache.iceberg.types.Type;\nimport org.apache.iceberg.types.Types;\nimport org.apache.spark.sql.vectorized.ColumnVector;\n\nclass ColumnVectorBuilder {\n\n  public ColumnVector build(VectorHolder holder, int numRows) {\n    if (holder instanceof VectorHolder.VariantVectorHolder) {\n      return new VariantColumnVector((VectorHolder.VariantVectorHolder) holder);\n    } else if (holder.isDummy()) {\n      if (holder instanceof VectorHolder.DeletedVectorHolder) {\n        return new DeletedColumnVector(Types.BooleanType.get());\n      } else if (holder instanceof ConstantVectorHolder) {\n        ConstantVectorHolder<?> constantHolder = (ConstantVectorHolder<?>) holder;\n        Type icebergType = constantHolder.icebergType();\n        Object value = constantHolder.getConstant();\n        return new ConstantColumnVector(icebergType, numRows, value);\n      } else {\n        throw new IllegalStateException(\"Unknown dummy vector holder: \" + holder);\n      }\n    } else {\n      return new IcebergArrowColumnVector(holder);\n    }\n  }\n}\n","sourceCodeStart":23,"sourceCodeEnd":48,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnVectorBuilder.java#L23-L48","documentation":"ColumnVectorBuilder.build() materializes a real Spark ColumnVector from a registered dummy vector holder. It recognizes specific holder implementations (constant, null, etc.); if the holder type is none of the known kinds, it throws IllegalStateException because the builder cannot know how to create a vector for it. This indicates an internal inconsistency: an unsupported or unexpected DummyVectorHolder was passed into the vectorized read path.","triggerScenarios":"Calling build() with a holder that is neither a known nor an instanceof a recognized DummyVectorHolder subclass (e.g. a new holder type added without extending build()'s dispatch, or a custom holder passed via readDataToColumnVectors).","commonSituations":"Developers adding a new DummyVectorHolder variant for a new Iceberg feature but forgetting to add the matching branch in ColumnVectorBuilder; upgrading Iceberg/Spark versions where holder classes changed; custom patches that introduce new holder types.","solutions":["Check the runtime class of the holder being passed (print holder.getClass()) and confirm it is one of the supported DummyVectorHolder implementations.","Add a matching instanceof branch in ColumnVectorBuilder.build() that constructs the appropriate ColumnVector for the new holder type.","If the holder should have been a known type, trace where it was created and fix the creation site to use a supported holder.","Upgrade to an Iceberg version where the holder type you need is supported in the vectorized read path."],"exampleFix":"// before\n} else {\n  throw new IllegalStateException(\"Unknown dummy vector holder: \" + holder);\n}\n// after\n} else if (holder instanceof MyNewVectorHolder) {\n  MyNewVectorHolder h = (MyNewVectorHolder) holder;\n  return new MyNewColumnVector(h.icebergType(), numRows, h.getValue());\n} else {\n  throw new IllegalStateException(\"Unknown dummy vector holder: \" + holder);\n}","handlingStrategy":"validation","validationCode":"if (!(holder instanceof ConstantVectorHolder<?> || holder instanceof NullVectorHolder)) {\n  throw new IllegalArgumentException(\"Unsupported dummy vector holder: \" + holder.getClass());\n}","typeGuard":"static boolean isSupportedHolder(DummyVectorHolder<?> h) {\n  return h instanceof ConstantVectorHolder<?> || h instanceof NullVectorHolder;\n}","tryCatchPattern":null,"preventionTips":["When adding a new DummyVectorHolder subclass, update every dispatch site (builder, readers) in the same PR.","Log holder.getClass() at registration time so mismatches surface early."],"tags":["spark","vectorized-read","internal-state","columnar"],"backgroundTag":"internal-invariant-violation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}