{"record":{"id":"ffaee26ab6e62fd1","repo":"apache/seatunnel","slug":"settypeinfo-method-is-not-supported-ffaee2","errorCode":null,"errorMessage":"setTypeInfo method is not supported","messagePattern":"setTypeInfo method is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java","lineNumber":43,"sourceCode":"\nimport java.io.Serializable;\nimport java.util.List;\n\npublic interface SeaTunnelTransform<T>\n        extends Serializable, PluginIdentifierInterface, SeaTunnelJobAware {\n\n    /** call it when Transformer initialed */\n    default void open() {}\n\n    /**\n     * Set the data type info of input data.\n     *\n     * @deprecated instead by {@link org.apache.seatunnel.api.table.factory.Factory}\n     * @param inputDataType The data type info of upstream input.\n     */\n    @Deprecated\n    default void setTypeInfo(SeaTunnelDataType<T> inputDataType) {\n        throw new UnsupportedOperationException(\"setTypeInfo method is not supported\");\n    }\n\n    /** Get the catalog table output by this transform */\n    CatalogTable getProducedCatalogTable();\n\n    List<CatalogTable> getProducedCatalogTables();\n\n    default SchemaChangeEvent mapSchemaChangeEvent(SchemaChangeEvent schemaChangeEvent) {\n        return schemaChangeEvent;\n    }\n\n    /**\n     * Called by the engine when an upstream transform's produced schema changes (e.g., after a\n     * schema-change event flows through the chain). Allows this transform to re-derive its state\n     * from the new upstream layout instead of applying schema changes to a stale local view.\n     *\n     * <p>Without this, downstream transforms in a chain accumulate divergence: each one applies the\n     * ALTER event locally (appending new cols at end of its own catalog), but the actual data row","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/transform/SeaTunnelTransform.java#L25-L61","documentation":"SeaTunnelTransform.setTypeInfo is the deprecated pre-Factory-API way to declare a transform's input type. The default implementation throws UnsupportedOperationException to signal that the transform does not support the legacy type-setting path, forcing migration to the Factory-based SPI.","triggerScenarios":"Calling setTypeInfo(...) on a transform implementation that does not override the default method (any modern transform using the Factory API) — typically from legacy translation/adapter code or old connector code written against the pre-2.3 API.","commonSituations":"Running old Flink/Spark translation code against a modern transform; a custom transform invoked through a legacy code path; following outdated examples that predate the CatalogTable/Factory refactor.","solutions":["Migrate the calling code to the Factory API: implement a TransformFactory and rely on applyTransform(...) instead of setTypeInfo","If implementing a transform that still needs this path, override setTypeInfo to accept the input SeaTunnelDataType","Update the job/config to a path that resolves the transform via its factory"],"exampleFix":"// before\ntransform.setTypeInfo(catalogTable.getSeaTunnelRowType());\n// after\nDataChangeEvent via factory:\nTableTransformFactory factory = (TableTransformFactory) discovery.get(TableTransformFactory.class.getSimpleName());\nTransform transform = factory.applyTransform(context);","handlingStrategy":"try-catch","validationCode":"// prefer the Factory API; only call setTypeInfo if the transform is legacy\nif (transform.getClass().isAnnotationPresent(Deprecated.class)) { transform.setTypeInfo(inputType); }","typeGuard":null,"tryCatchPattern":"try { transform.setTypeInfo(inputType); } catch (UnsupportedOperationException e) { // transform uses Factory API; obtain type via transform.getProducedCatalogTable() }","preventionTips":["Migrate to the TransformFactory SPI instead of the deprecated setTypeInfo path","Check @Deprecated annotations before calling legacy API methods","Prefer constructing transforms via Factory discovery"],"tags":["transform","deprecated-api","unsupported-operation"],"backgroundTag":"deprecated-api-usage","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}