{"record":{"id":"8920d9e351018afe","repo":"apache/beam","slug":"no-conversion-exists-from-type-valuetype-to-beam-type","errorCode":null,"errorMessage":"No conversion exists from type: {valueType} to Beam type.","messagePattern":"No conversion exists from type: (.+?) to Beam type\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/EntityToRow.java","lineNumber":138,"sourceCode":"          return val.getKeyValue().toByteArray();\n        case BLOB_VALUE:\n          return val.getBlobValue().toByteArray();\n        case ENTITY_VALUE:\n          // Recursive mapping for row type.\n          Schema rowSchema = currentFieldType.getRowSchema();\n          assert rowSchema != null;\n          Entity entity = val.getEntityValue();\n          return extractRowFromProperties(rowSchema, entity.getPropertiesMap());\n        case ARRAY_VALUE:\n          // Recursive mapping for collection type.\n          Schema.FieldType elementType = currentFieldType.getCollectionElementType();\n          List<Value> valueList = val.getArrayValue().getValuesList();\n          return valueList.stream()\n              .map(v -> convertValueToObject(elementType, v))\n              .collect(Collectors.toList());\n        case GEO_POINT_VALUE:\n        default:\n          throw new IllegalStateException(\n              \"No conversion exists from type: \"\n                  + val.getValueTypeCase().name()\n                  + \" to Beam type.\");\n      }\n    }\n\n    /**\n     * Converts all properties of an {@code Entity} to Beam {@code Row}.\n     *\n     * @param schema Target row {@code Schema}.\n     * @param values A map of property names and values.\n     * @return resulting Beam {@code Row}.\n     */\n    private Row extractRowFromProperties(Schema schema, Map<String, Value> values) {\n      Row.Builder builder = Row.withSchema(schema);\n      // It is not a guarantee that the values will be in the same order as the schema.\n      // Maybe metadata:\n      // https://cloud.google.com/appengine/docs/standard/python/datastore/metadataqueries","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/EntityToRow.java#L120-L156","documentation":"convertValueToObject maps Datastore protobuf Value types to Java objects for Beam Rows. The switch handles KEY, BOOLEAN, INTEGER, DOUBLE, STRING, TIMESTAMP, ARRAY etc., but GEO_POINT_VALUE (and any unrecognized type) falls into the default branch and throws. Beam's EntityToRow simply has no conversion defined for GeoPoint values.","triggerScenarios":"Reading a Datastore Entity whose property is a GeoPoint (latLng value), or an entirely unknown/new Value type case, during convertValueToObject called from extractRowFromProperties.","commonSituations":"Datastore entities containing lat/long GeoPoint properties being read into Beam; a Datastore API version introducing value types this Beam converter predates; array elements (recursive call) containing GeoPoints.","solutions":["Avoid reading entities with GeoPoint properties, or filter those properties out before conversion","Convert the GeoPoint yourself by extending/forking the converter: map GEO_POINT_VALUE to a ROW{lat: DOUBLE, lng: DOUBLE} or two DOUBLE fields","Flatten GeoPoints into separate latitude/longitude properties in Datastore so no GEO_POINT_VALUE reaches the reader","Upgrade to the latest Beam version in case new value-type conversions were added"],"exampleFix":"// before\ncase GEO_POINT_VALUE:\ndefault:\n  throw new IllegalStateException(\"No conversion exists from type: \"\n      + val.getValueTypeCase().name() + \" to Beam type.\");\n// after\ncase GEO_POINT_VALUE:\n  return Row.withSchema(GEO_POINT_SCHEMA)\n      .addValues(val.getGeoPointValue().getLatitude(), val.getGeoPointValue().getLongitude())\n      .build();\ndefault:\n  throw new IllegalStateException(\"No conversion exists from type: \"\n      + val.getValueTypeCase().name() + \" to Beam type.\");","handlingStrategy":"validation","validationCode":"// Inspect entities before conversion and reject unsupported value types:\nfor (Map.Entry<String, Value> e : entity.getPropertiesMap()) {\n  Value.TypeCase t = e.getValue().getValueTypeCase();\n  if (t == Value.TypeCase.GEO_POINT_VALUE) {\n    throw new IllegalArgumentException(\"Property \" + e.getKey() + \" is a GeoPoint; not convertible to Beam type\");\n  }\n}","typeGuard":"boolean isConvertible(Value val) {\n  switch (val.getValueTypeCase()) {\n    case KEY_VALUE: case BOOLEAN_VALUE: case INTEGER_VALUE: case DOUBLE_VALUE:\n    case STRING_VALUE: case TIMESTAMP_VALUE: case ARRAY_VALUE: case NULL_VALUE:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try {\n  row = extractRowFromProperties(entity.getPropertiesMap());\n} catch (IllegalStateException e) {\n  LOG.error(\"Unconvertible Datastore value in entity {}: {}\", entity.getKey(), e.getMessage());\n  throw e;\n}","preventionTips":["Model GeoPoints as separate latitude/longitude properties in Datastore instead of GeoPoint values","Audit source entities for GeoPoint properties before wiring DatastoreIO reads","Pin Beam and Datastore client versions so converter coverage matches the API value types in use"],"tags":["gcp","datastore","conversion","unsupported-type","beam"],"backgroundTag":"unsupported-operation","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"}