adarsh
adarsh

Reputation: 1141

Reading data from one datastore and writing to another, with Google cloud dataflow

I am trying to process some data from one datastore (from a project A), and write it to another (in project B). My runs are failing with the exception -

 com.google.datastore.v1.client.DatastoreException: mismatched databases within request: <unknown!>~projecta vs. <unknown!>~projectb, code=INVALID_ARGUMENT

Is it not possible to do such a thing from cloud dataflow?

Upvotes: 4

Views: 522

Answers (1)

Frank Wilson
Frank Wilson

Reputation: 3250

I can't really tell what you did from a single error, but you probably tried to save entities from a query from one datastore instance to another. The trouble is the datastore instance id is embedded in each key. So (as a starting point) you should probably create new entity objects using the properties from the query results and save those instead.

Upvotes: 5

Related Questions