{"record":{"id":"251d2ca3e55e2d03","repo":"apache/beam","slug":"the-type-is-not-supported-typename","errorCode":null,"errorMessage":"The type is not supported: ${typeName}","messagePattern":"The type is not supported: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/nfa/NFA.java","lineNumber":197,"sourceCode":"          return CEPLiteral.of(row.getInt16(fieldIndex));\n        case INT32:\n          return CEPLiteral.of(row.getInt32(fieldIndex));\n        case INT64:\n          return CEPLiteral.of(row.getInt64(fieldIndex));\n        case DECIMAL:\n          return CEPLiteral.of(row.getDecimal(fieldIndex));\n        case FLOAT:\n          return CEPLiteral.of(row.getFloat(fieldIndex));\n        case DOUBLE:\n          return CEPLiteral.of(row.getDouble(fieldIndex));\n        case DATETIME:\n          return CEPLiteral.of(row.getDateTime(fieldIndex));\n        case BOOLEAN:\n          return CEPLiteral.of(row.getBoolean(fieldIndex));\n        case STRING:\n          return CEPLiteral.of(row.getString(fieldIndex));\n        default:\n          throw new UnsupportedOperationException(\n              \"The type is not supported: \" + type.getTypeName().toString());\n      }\n    }\n\n    private Event findEvent(EventPointer eventPointer) {\n      return prevEvents.getOrDefault(eventPointer, null);\n    }\n\n    private EventPointer findEventPointer(EventPointer pointer) {\n      for (EventPointer i : prevEvents.keySet()) {\n        if (i.equals(pointer)) {\n          return i.copy();\n        }\n      }\n      return null;\n    }\n\n    public EventPointer getPrevPointer(EventPointer curPointer) {","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/nfa/NFA.java#L179-L215","documentation":"NFA.toCEPLiteral converts an event row field into a CEPLiteral for condition evaluation. It supports DATE/TIME/TIMESTAMP, BOOLEAN, and STRING cases (plus numeric cases above the shown region); any other primitive type in the row schema falls into the default branch and throws UnsupportedOperationException naming the type.","triggerScenarios":"A DEFINE/MEASURES condition references a field whose Beam row type is not one of the supported CEP literal types (e.g. BYTES, ARRAY, MAP, ROW, or an unsupported logical type).","commonSituations":"MATCH_RECOGNIZE over PCollections containing array/map/struct columns referenced in conditions; schema evolution adding a complex field later used in DEFINE.","solutions":["Change the referenced field's schema type to a supported primitive (e.g. use STRING instead of BYTES/ARRAY).","Pre-process the PCollection to flatten/convert complex fields into supported primitives before MATCH_RECOGNIZE.","Extend NFA.toCEPLiteral with a case for the needed type (e.g. BYTE_ARRAY).","Validate the input schema fields used in DEFINE/MEASURES against the supported type set at pipeline-construction time."],"exampleFix":"// before (schema)\n.addField(\"tags\", FieldType.array(FieldType.STRING))\n// after\n.addField(\"tags\", FieldType.STRING) // e.g. joined/encoded, and update DEFINE accordingly","handlingStrategy":"validation","validationCode":"// Before MATCH_RECOGNIZE, assert condition fields use supported types\nSet<String> ok = Set.of(\"INT32\",\"INT64\",\"FLOAT\",\"DOUBLE\",\"BOOLEAN\",\"STRING\",\"DATE\",\"TIME\",\"TIMESTAMP\");\nfor (String f : conditionFields) check(ok.contains(schema.getField(f).getType().getTypeName().toString()), f);","typeGuard":"boolean isCepSupportedType(FieldType t) { return switch (t.getTypeName()) { case INT32, INT64, FLOAT, DOUBLE, BOOLEAN, STRING, DATETIME -> true; default -> false; }; }","tryCatchPattern":"try { return nfa.eval(...); } catch (UnsupportedOperationException e) { throw new SchemaValidationException(\"Condition field type unsupported: \" + e.getMessage(), e); }","preventionTips":["Keep fields referenced in DEFINE/MEASURES restricted to scalar primitives.","Flatten or encode arrays/maps/rows upstream before pattern matching.","Re-validate the schema after any schema evolution."],"tags":["java","nfa","cep","schema","unsupported-type"],"backgroundTag":"unsupported-dtype","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"}