{"record":{"id":"fefad399da78c950","repo":"apache/beam","slug":"no-conversion-exists-from-type-valueclass-to-datastove-value","errorCode":null,"errorMessage":"No conversion exists from type: {valueClass} to DataStove Value.","messagePattern":"No conversion exists from type: (.+?) to DataStove Value\\.","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/RowToEntity.java","lineNumber":201,"sourceCode":"        return makeValue((Float) value).build();\n      } else if (String.class.equals(value.getClass())) {\n        return makeValue((String) value).build();\n      } else if (Instant.class.equals(value.getClass())) {\n        return makeValue(((Instant) value).toDate()).build();\n      } else if (byte[].class.equals(value.getClass())) {\n        return makeValue(ByteString.copyFrom((byte[]) value)).build();\n      } else if (value instanceof Row) {\n        // Recursive conversion to handle nested rows.\n        Row row = (Row) value;\n        return makeValue(constructEntityFromRow(row.getSchema(), row)).build();\n      } else if (value instanceof Collection) {\n        // Recursive to handle nested collections.\n        Collection<Object> collection = (Collection<Object>) value;\n        List<Value> arrayValues =\n            collection.stream().map(this::mapObjectToValue).collect(Collectors.toList());\n        return makeValue(arrayValues).build();\n      }\n      throw new IllegalStateException(\n          \"No conversion exists from type: \" + value.getClass() + \" to DataStove Value.\");\n    }\n  }\n}\n","sourceCodeStart":183,"sourceCodeEnd":206,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/datastore/RowToEntity.java#L183-L206","documentation":"RowToEntity.mapObjectToValue maps Beam Row field Java types (String, Integer, Long, Double, Boolean, ByteArray, timestamps, nested Rows, collections, etc.) to datastore Value types. If the object's runtime class has no mapping, an IllegalStateException is thrown stating no conversion exists (note the 'DataStove' typo). It is a coding/schema error, not a data error.","triggerScenarios":"A Beam Row field contains a Java type not in RowToEntity's instanceof ladder — e.g. a BigDecimal, a custom POJO, java.sql.Timestamp, or an unsupported numeric/wrapper type — and that field is converted to a Datastore entity value.","commonSituations":"Schema evolution adding a field with a logical type RowToEntity doesn't support; passing a raw Map (not converted to Row) or BigDecimal into the row; newer Beam SDK field types on an older conversion path.","solutions":["Change the field type in the Beam Schema/Row to one of the supported types (String, Integer, Long, Double, Boolean, byte[], Instant, Row, Collection)","Convert unsupported values (e.g. BigDecimal) to String or Double before building the Row","Write a custom DoFn to Datastore Value mapping instead of RowToEntity if exotic types are required","Check the Beam SDK version for added type support and upgrade if a needed mapping exists upstream"],"exampleFix":"// before\nrow.of(row.getBigDecimal(\"amount\")) // no conversion for BigDecimal\n// after\nrow.of(row.getBigDecimal(\"amount\").doubleValue()) // or .toPlainString()","handlingStrategy":"type-guard","validationCode":"Object v = row.getValue(field);\nif (!(v instanceof String || v instanceof Integer || v instanceof Long || v instanceof Double\n    || v instanceof Boolean || v instanceof byte[] || v instanceof Instant || v instanceof Row\n    || v instanceof Collection)) {\n  throw new IllegalArgumentException(\"Unsupported type for Datastore value: \" + v.getClass());\n}","typeGuard":"boolean isDatastoreConvertible(Object v) {\n  return v instanceof String || v instanceof Integer || v instanceof Long || v instanceof Double\n      || v instanceof Boolean || v instanceof byte[] || v instanceof Instant\n      || v instanceof Row || v instanceof Collection;\n}","tryCatchPattern":"try {\n  entity = rowToEntityFn.convert(row);\n} catch (IllegalStateException e) {\n  LOG.error(\"Field type not convertible to Datastore Value\", e); // fix schema or convert value\n}","preventionTips":["Restrict Beam schemas feeding Datastore IO to natively supported types","Convert BigDecimal/POJO/Map fields to supported types when building Rows","Pin and review the Beam SDK version's RowToEntity supported type list"],"tags":["java","google-cloud-datastore","type-mismatch"],"backgroundTag":"unsupported-operation","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"}