{"record":{"id":"260535fefb61e7b6","repo":"apache/beam","slug":"column-s-has-array-of-arrays-which-is-prohibited-in-spanner","errorCode":null,"errorMessage":"Column %s has array of arrays which is prohibited in Spanner.","messagePattern":"Column (.+?) has array of arrays which is prohibited in Spanner\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/StructUtils.java","lineNumber":464,"sourceCode":"            .collect(toList());\n\n        // TODO: implement logical date\n      case DATE:\n        return struct.getDateList(column).stream()\n            .map(date -> DateTime.parse(date.toString()))\n            .collect(toList());\n      case INT64:\n        return struct.getLongList(column);\n      case FLOAT32:\n        return struct.getFloatList(column);\n      case FLOAT64:\n        return struct.getDoubleList(column);\n      case STRING:\n        return struct.getStringList(column);\n      case NUMERIC:\n        return struct.getBigDecimalList(column);\n      case ARRAY:\n        throw new IllegalStateException(\n            String.format(\"Column %s has array of arrays which is prohibited in Spanner.\", column));\n      case STRUCT:\n        return struct.getStructList(column).stream()\n            .map(\n                structElem -> {\n                  Schema.@Nullable FieldType fieldType = field.getType().getCollectionElementType();\n                  if (fieldType == null) {\n                    throw new NullPointerException(\n                        \"Null collection element type at field \" + field.getName());\n                  }\n\n                  @Nullable Schema elementSchema = fieldType.getRowSchema();\n                  if (elementSchema == null) {\n                    throw new NullPointerException(\n                        \"Null schema element type at field \" + field.getName());\n                  }\n                  return structToBeamRow(structElem, elementSchema);\n                })","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/StructUtils.java#L446-L482","documentation":"getStructArrayValue handles ARRAY columns. An ARRAY whose elements are themselves arrays (ARRAY<ARRAY<T>>) is prohibited by Cloud Spanner's data model, so this IllegalStateException is a defensive invariant check. It should only trigger if a type code arrives nested despite Spanner disallowing it.","triggerScenarios":"Reading an ARRAY-typed Spanner column where the array element type code is also ARRAY, e.g. from future/odd backend responses or mis-declared schema metadata passed into getStructArrayValue.","commonSituations":"Rare: schema metadata mismatch after Spanner/SDK version changes; hand-constructed Type objects in tests that model arrays of arrays.","solutions":["Inspect the column definition; Spanner cannot store arrays of arrays, so fix the schema/query producing this shape.","If it comes from test fixtures or hand-built Type objects, correct them to a legal Spanner type.","Upgrade the SDK in case a fixed backend mapping resolves the misclassification."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Spanner forbids nested arrays; validate declared schema metadata\nif (arrayType.getArrayElementType().getCode() == Type.Code.ARRAY) {\n  throw new IllegalStateException(\"ARRAY<ARRAY<T>> is prohibited in Spanner; fix schema metadata\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never model ARRAY<ARRAY<T>> in tests or fixtures.","Verify schema metadata matches the actual DDL.","Regenerate schema metadata after Spanner version changes."],"tags":["spanner","arrays","invariant","java"],"backgroundTag":"internal-invariant-violation","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"}