{"record":{"id":"279cd83abd3410a9","repo":"apache/beam","slug":"column-type-s-is-not-supported-yet","errorCode":null,"errorMessage":"Column type %s is not supported yet!","messagePattern":"Column type (.+?) is not supported yet!","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/schema/BeamTableUtils.java","lineNumber":171,"sourceCode":"      String raw = rawObj.toString();\n      if (raw.trim().isEmpty()) {\n        return null;\n      }\n      switch (type.getTypeName()) {\n        case BYTE:\n          return Byte.valueOf(raw);\n        case INT16:\n          return Short.valueOf(raw);\n        case INT32:\n          return Integer.valueOf(raw);\n        case INT64:\n          return Long.valueOf(raw);\n        case FLOAT:\n          return Float.valueOf(raw);\n        case DOUBLE:\n          return Double.valueOf(raw);\n        default:\n          throw new UnsupportedOperationException(\n              String.format(\"Column type %s is not supported yet!\", type));\n      }\n    } else if (type.getTypeName().isPrimitiveType()) {\n      // handle bytes represented by ByteString\n      if (TypeName.BYTES.equals(type.getTypeName()) && rawObj instanceof ByteString) {\n        return ((ByteString) rawObj).getBytes();\n        // handle Float <-> Double mixed use\n      } else if (TypeName.FLOAT.equals(type.getTypeName()) && rawObj instanceof Double) {\n        return ((Double) rawObj).floatValue();\n      } else if (TypeName.DOUBLE.equals(type.getTypeName()) && rawObj instanceof Float) {\n        return ((Float) rawObj).doubleValue();\n      }\n    }\n    return rawObj;\n  }\n}\n","sourceCodeStart":153,"sourceCodeEnd":188,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/schema/BeamTableUtils.java#L153-L188","documentation":"autoCastField's string-casting switch only supports STRING, INTEGER, LONG, FLOAT and DOUBLE schema types; any other column type encountered while casting a raw value throws UnsupportedOperationException stating the type is unsupported.","triggerScenarios":"Loading CSV data into a schema containing types like BOOLEAN, DATETIME, DECIMAL, or BYTES for which the cast branch has no case — the default branch fires.","commonSituations":"Schemas with date/timestamp or boolean columns read from plain CSV text; newer Beam versions add types not yet handled by this util (or vice versa, older Beam missing newer types).","solutions":["Upgrade Beam to a version where autoCastField supports the needed type","Pre-convert unsupported columns to STRING in the schema and cast after parsing","Transform values (e.g. parse dates) in a custom DoFn instead of relying on CSV auto-cast"],"exampleFix":"// before\nSchema.Field.of(\"ts\", Schema.FieldType.DATETIME) // unsupported in CSV auto-cast\n// after\nSchema.Field.of(\"ts_str\", Schema.FieldType.STRING) // parse with ParDo afterwards","handlingStrategy":"validation","validationCode":"schema.getFields().forEach(f -> { switch (f.getType().getTypeName()) { case STRING: case INTEGER: case LONG: case FLOAT: case DOUBLE: break; default: throw new UnsupportedOperationException(\"CSV auto-cast unsupported: \" + f.getType()); } });","typeGuard":"boolean csvCastable(Schema.FieldType t) { return java.util.Set.of(TypeName.STRING, TypeName.INTEGER, TypeName.INT64, TypeName.FLOAT, TypeName.DOUBLE).contains(t.getTypeName()); }","tryCatchPattern":"try { rows = BeamTableUtils.csvLines2BeamRows(...); } catch (UnsupportedOperationException e) { /* use STRING fields + custom cast DoFn */ }","preventionTips":["Restrict CSV source schemas to supported primitive types","Pre-parse dates/booleans with custom DoFns","Check Beam version's supported cast types before schema design"],"tags":["csv","schema","type-mismatch"],"backgroundTag":"type-mismatch","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"}