{"record":{"id":"63d9a6e7b901a51b","repo":"apache/beam","slug":"unsupported-delta-type-deltatype-getclass","errorCode":null,"errorMessage":"Unsupported Delta type: <deltaType.getClass()>","messagePattern":"Unsupported Delta type: <deltaType\\.getClass\\(\\)>","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaIO.java","lineNumber":219,"sourceCode":"        return Schema.FieldType.BYTES;\n      } else if (deltaType instanceof TimestampType) {\n        return Schema.FieldType.logicalType(Timestamp.MICROS);\n      } else if (deltaType instanceof TimestampNTZType) {\n        return Schema.FieldType.logicalType(SqlTypes.DATETIME);\n      } else if (deltaType instanceof DateType) {\n        return Schema.FieldType.logicalType(SqlTypes.DATE);\n      } else if (deltaType instanceof ArrayType) {\n        DataType elementType = ((ArrayType) deltaType).getElementType();\n        return Schema.FieldType.iterable(convertToBeamFieldType(elementType));\n      } else if (deltaType instanceof MapType) {\n        DataType keyType = ((MapType) deltaType).getKeyType();\n        DataType valueType = ((MapType) deltaType).getValueType();\n        return Schema.FieldType.map(\n            convertToBeamFieldType(keyType), convertToBeamFieldType(valueType));\n      } else if (deltaType instanceof StructType) {\n        return Schema.FieldType.row(convertToBeamSchema((StructType) deltaType));\n      } else {\n        throw new UnsupportedOperationException(\"Unsupported Delta type: \" + deltaType.getClass());\n      }\n    }\n  }\n\n  static Schema buildPublicBeamSchema(Schema baseSchema, @Nullable List<String> metadataColumns) {\n    if (metadataColumns == null || metadataColumns.isEmpty()) {\n      return baseSchema;\n    }\n    Schema.Builder builder = Schema.builder();\n    for (Schema.Field field : baseSchema.getFields()) {\n      builder.addField(field);\n    }\n    for (String col : metadataColumns) {\n      if (col.equals(CHANGE_TYPE_COLUMN)) {\n        builder.addField(CHANGE_TYPE_COLUMN, Schema.FieldType.STRING);\n      } else if (col.equals(COMMIT_VERSION_COLUMN)) {\n        builder.addField(COMMIT_VERSION_COLUMN, Schema.FieldType.INT64);\n      } else if (col.equals(COMMIT_TIMESTAMP_COLUMN)) {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaIO.java#L201-L237","documentation":"convertToBeamFieldType maps Delta DataType values (BooleanType, integer/float types, DateType, TimestampType, StringType, BinaryType, ArrayType, MapType, StructType) to Beam Schema.FieldType. Any Delta type outside the supported set reaches the else branch and throws UnsupportedOperationException naming the Delta type class.","triggerScenarios":"A table whose schema contains a Delta type this connector doesn't map — e.g. VariantType, new types introduced by newer Delta writer versions, or unusual nested types.","commonSituations":"Tables written by recent Delta/Spark versions using Variant or other new data types; protocol upgrades enabling features this Beam connector predates.","solutions":["Upgrade the Beam delta-io connector to a release that maps the new Delta type.","Avoid or drop the unsupported column: create a view/CTAS excluding it, or cast it to a supported type (e.g. cast Variant to STRING) at the writer.","If you control the schema, change the column type in the Delta table to one in the supported set.","As a workaround, read the table with a different engine (Spark) if the type is essential."],"exampleFix":"// before\nCREATE TABLE t (v VARIANT); // Beam delta connector has no Variant mapping\n// after\nCREATE TABLE t (v STRING); -- or CAST(v AS STRING) via CTAS","handlingStrategy":"validation","validationCode":"// inspect table columns before reading; reject unsupported Delta types\n// e.g. via delta-spark: DESCRIBE TABLE <path> and compare types against the connector's supported set","typeGuard":"static boolean isSupportedDeltaType(io.delta.kernel.types.DataType t) {\n  return t instanceof io.delta.kernel.types.BooleanType || t instanceof io.delta.kernel.types.StringType\n      || t instanceof io.delta.kernel.types.IntegerType || t instanceof io.delta.kernel.types.LongType\n      || t instanceof io.delta.kernel.types.ArrayType || t instanceof io.delta.kernel.types.MapType\n      || t instanceof io.delta.kernel.types.StructType;\n}","tryCatchPattern":"try { pipeline.run(); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith(\"Unsupported Delta type:\")) { castUnsupportedColumnAndRerun(); } else { throw e; } }","preventionTips":["Restrict table schemas to types the connector maps; cast new types (Variant etc.) to STRING at write time.","Upgrade the Beam connector when adopting newer Delta writer features.","Run a schema check as part of pipeline validation before each deploy."],"tags":["java","delta-lake","schema","type-mapping","unsupported-type"],"backgroundTag":"type-mismatch","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"}