{"record":{"id":"f1a3dd6bc44d17df","repo":"apache/beam","slug":"unrecognized-dialect-dialect-name-spannerschema","errorCode":null,"errorMessage":"Unrecognized dialect: + dialect.name()","messagePattern":"Unrecognized dialect: \\+ dialect\\.name\\(\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerSchema.java","lineNumber":264,"sourceCode":"            Type itemType = parseSpannerType(spannerArrayType, dialect);\n            return Type.array(itemType);\n          }\n          type = POSTGRES_TYPE_MAP.get(spannerType);\n          if (type != null) {\n            return type;\n          }\n          if (spannerType.startsWith(\"CHARACTER VARYING\")) {\n            return Type.string();\n          }\n          if (spannerType.startsWith(\"NUMERIC\")) {\n            return Type.pgNumeric();\n          }\n          if (spannerType.startsWith(\"JSONB\")) {\n            return Type.pgJsonb();\n          }\n          throw new IllegalArgumentException(\"Unknown spanner type \" + spannerType);\n        default:\n          throw new IllegalArgumentException(\"Unrecognized dialect: \" + dialect.name());\n      }\n    }\n  }\n}\n","sourceCodeStart":246,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerSchema.java#L246-L269","documentation":"parseSpannerType switches on the database Dialect (GOOGLE_SQL / POSTGRESQL); hitting the default branch means the Dialect enum value passed in is not recognized, and it throws IllegalArgumentException(\"Unrecognized dialect: \" + dialect.name()). Since Dialect has only two values, this indicates a corrupt/extended enum or a version mismatch.","triggerScenarios":"Calling SpannerSchema.create(spannerSchema, dialect) or itemType with a Dialect value outside {GOOGLE_SQL, POSTGRESQL} — practically only via a shading/relocation conflict or a custom Dialect enum from a different Beam version on the classpath.","commonSituations":"Classpath pollution with multiple beam-sdks-java-io-google-cloud-platform versions; custom forks adding a Dialect constant passed into stock SpannerSchema.","solutions":["Check the dialect name printed in the message and ensure only SpannerSchema.Dialect GOOGLE_SQL or POSTGRESQL is used.","Resolve duplicate Beam IO jar versions on the classpath (dependency:tree, exclusions).","Upgrade Beam so both the Dialect enum and SpannerSchema come from the same version."],"exampleFix":"// before\nSpannerSchema.create(schema, Dialect.valueOf(\"MONGODB\"));\n// after\nSpannerSchema.create(schema, Dialect.GOOGLE_SQL);","handlingStrategy":"validation","validationCode":"if (dialect != Dialect.GOOGLE_SQL && dialect != Dialect.POSTGRESQL) {\n  throw new IllegalArgumentException(\"Unsupported dialect: \" + dialect);\n}","typeGuard":null,"tryCatchPattern":"try { SpannerSchema.create(s, dialect); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unrecognized dialect\")) { /* fix classpath/dialect source */ } throw e; }","preventionTips":["Use only SpannerSchema.Dialect constants from your Beam version.","Ensure a single beam-sdks-java-io-google-cloud-platform version on the classpath."],"tags":["java","beam","spanner","dialect","illegal-argument"],"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-14T21:17:11.552Z"}