{"record":{"id":"c11538eeff5097ed","repo":"apache/beam","slug":"unsupported-type-type-getclass","errorCode":null,"errorMessage":"Unsupported type: <type.getClass()>","messagePattern":"Unsupported type: <type\\.getClass\\(\\)>","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaSourceDoFn.java","lineNumber":300,"sourceCode":"      int size = mapValue.getSize();\n      ColumnVector keys = mapValue.getKeys();\n      ColumnVector values = mapValue.getValues();\n      DataType keyType = ((MapType) type).getKeyType();\n      DataType valueType = ((MapType) type).getValueType();\n      Map<Object, @Nullable Object> map = new LinkedHashMap<>(size);\n      for (int i = 0; i < size; i++) {\n        Object key = getVectorValue(keys, i, keyType);\n        if (key != null) {\n          map.put(key, getVectorValue(values, i, valueType));\n        }\n      }\n      return map;\n    } else if (type instanceof StructType) {\n      io.delta.kernel.data.Row nestedRow = row.getStruct(index);\n      Schema nestedBeamSchema = DeltaIO.ReadRows.convertToBeamSchema((StructType) type);\n      return toBeamRow(nestedRow, nestedBeamSchema);\n    }\n    throw new UnsupportedOperationException(\"Unsupported type: \" + type.getClass());\n  }\n\n  // Returns the value at a specific index in a given column vector.\n  private static @Nullable Object getVectorValue(ColumnVector vector, int index, DataType type) {\n    if (vector.isNullAt(index)) {\n      return null;\n    }\n    if (type instanceof BooleanType) {\n      return vector.getBoolean(index);\n    } else if (type instanceof ByteType) {\n      return (int) vector.getByte(index);\n    } else if (type instanceof ShortType) {\n      return (int) vector.getShort(index);\n    } else if (type instanceof IntegerType) {\n      return vector.getInt(index);\n    } else if (type instanceof LongType) {\n      return vector.getLong(index);\n    } else if (type instanceof FloatType) {","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaSourceDoFn.java#L282-L318","documentation":"getFieldValue() recursively converts Delta kernel values into Beam values but only handles known DataType variants (Boolean, Byte, Short, Int, Long, Float, Double, String, Binary, Date, Timestamp, ArrayType, MapType, StructType). When the top-level column's DataType is anything else, it throws UnsupportedOperationException naming the Java class.","triggerScenarios":"A Delta table column with a Delta Kernel DataType not covered by the conversion switch reaches toBeamRow() during processElement — typically a new/protocol-level type or a variant the connector has no mapping for.","commonSituations":"Reading tables written by a newer Delta protocol introducing new types; unhandled calendar-interval or variant/unparsed types in the schema; using a connector version older than the table's writer features.","solutions":["Upgrade the Beam Delta IO connector and io.delta kernel to a version that supports the column type","Inspect the table schema and identify the offending column/type","Rewrite the table casting the unsupported column to a supported type (e.g. string, long)","As a last resort, exclude the unsupported column by projecting a reduced schema before reading"],"exampleFix":"// before\n// column of unsupported kernel type read directly\nPCollection<Row> rows = input.apply(DeltaIO.read().withTable(path).withStartVersion(0L));\n// after\n-- rewrite the table casting the unsupported column\nALTER TABLE delta.`/path` ALTER COLUMN weird_col TYPE STRING; -- or rewrite via Spark with cast()","handlingStrategy":"validation","validationCode":"// Inspect the table schema before reading and fail early on unknown types\nStructType schema = /* snapshot.getSchema() via Delta client */;\nfor (StructField f : schema.fields()) {\n  if (!isSupportedBeamMapping(f.getDataType())) {\n    throw new IllegalStateException(\"Column \" + f.getName() + \" has unsupported type \" + f.getDataType());\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  rows = input.apply(deltaIO);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported type:\")) {\n    // identify column from schema, cast/rewrite table or upgrade connector\n  } else { throw e; }\n}","preventionTips":["Check the table's protocol and types against connector support before onboarding it to Beam","Keep beam-sdks-java-io-delta and io.delta kernel versions current","Cast exotic columns to primitive types during table ETL"],"tags":["java","apache-beam","delta-lake","unsupported-type","type-mismatch"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}