{"record":{"id":"6a09271f5f89ca3f","repo":"apache/beam","slug":"field-mode-columnmode-is-not-supported-field-name","errorCode":null,"errorMessage":"Field mode '{columnMode}' is not supported (field '{name}')","messagePattern":"Field mode '(.+?)' is not supported \\(field '(.+?)'\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/SchemaUtils.java","lineNumber":79,"sourceCode":"    return columnsMap.stream().map(SchemaUtils::toBeamField).collect(toSchema());\n  }\n\n  private static Field toBeamField(ColumnSchema column) {\n    String name = column.getColumn();\n\n    // basic field type\n    FieldType fieldType = getBeamFieldType(column);\n    Field field = Field.of(name, fieldType);\n\n    // set the nullable flag, or convert to a list if repeated\n    if (Strings.isNullOrEmpty(column.getMode()) || \"NULLABLE\".equals(column.getMode())) {\n      field = field.withNullable(true);\n    } else if (\"REQUIRED\".equals(column.getMode())) {\n      field = field.withNullable(false);\n    } else if (\"REPEATED\".equals(column.getMode())) {\n      field = Field.of(name, FieldType.array(fieldType));\n    } else {\n      throw new UnsupportedOperationException(\n          \"Field mode '\" + column.getMode() + \"' is not supported (field '\" + name + \"')\");\n    }\n\n    return field;\n  }\n\n  private static FieldType getBeamFieldType(ColumnSchema column) {\n    String dcFieldType = column.getType();\n\n    if (FIELD_TYPES.containsKey(dcFieldType)) {\n      return FIELD_TYPES.get(dcFieldType);\n    }\n\n    if (\"STRUCT\".equals(dcFieldType)) {\n      Schema structSchema = fromColumnsList(column.getSubcolumnsList());\n      return FieldType.row(structSchema);\n    }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/SchemaUtils.java#L61-L97","documentation":"toBeamField maps a Data Catalog ColumnSchema to a Beam field and found a mode value other than the recognized NULLABLE/REQUIRED/REPEATED (e.g. unknown or null on a column where mode matters for nullability/list conversion). The column's mode string is the faulty input and cannot be represented in a Beam schema field.","triggerScenarios":"A column in the Data Catalog schema has getMode() returning an unexpected string (e.g. legacy, custom, or unset-but-nonstandard mode) when converting to a Beam Schema.","commonSituations":"Schemas written by other tools into Data Catalog with non-standard mode values, or proto fields left unset producing a mode string outside the three known ones.","solutions":["Set the column mode to one of NULLABLE, REQUIRED, or REPEATED in the Data Catalog schema","Ensure the mode field is not empty/unset when the column is created","Pre-convert the schema to only use supported modes before registering the entry"],"exampleFix":"// before\ncolumn.setMode('OPTIONAL')\n// after\ncolumn.setMode('NULLABLE')","handlingStrategy":"validation","validationCode":"for (ColumnSchema c : schema.getColumnsList()) {\n  String m = c.getMode();\n  if (!\"NULLABLE\".equals(m) && !\"REQUIRED\".equals(m) && !\"REPEATED\".equals(m)) {\n    throw new IllegalArgumentException(\"Bad mode '\" + m + \"' for field \" + c.getColumn());\n  }\n}","typeGuard":"static boolean hasSupportedMode(ColumnSchema c) {\n  return java.util.Arrays.asList(\"NULLABLE\",\"REQUIRED\",\"REPEATED\").contains(c.getMode());\n}","tryCatchPattern":"try {\n  Schema s = SchemaUtils.fromDataCatalog(dcSchema);\n} catch (UnsupportedOperationException ex) {\n  LOG.error(\"Unsupported column mode in DC schema\", ex);\n}","preventionTips":["Only set NULLABLE/REQUIRED/REPEATED modes when authoring schemas","Never leave mode unset; explicitly set NULLABLE for optional fields","Validate schemas with a checker before registering entries"],"tags":["datacatalog","schema","field-mode"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}