使用Google云数据流从一个数据存储区读取数据并写入另一个数据存储区

时间:2021-05-10 15:25:10

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 -

我正在尝试处理来自一个数据存储区(来自项目A)的一些数据,并将其写入另一个数据存储区(在项目B中)。我的跑步失败了例外 -

 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?

是不是可以从云数据流中做这样的事情?

1 个解决方案

#1


4  

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.

我无法真正告诉您从单个错误中做了什么,但您可能尝试将查询中的实体从一个数据存储区实例保存到另一个数据存储区实例。麻烦的是数据存储区实例id嵌入在每个密钥中。所以(作为一个起点)你应该使用查询结果中的属性创建新的实体对象并保存它们。

#1


4  

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.

我无法真正告诉您从单个错误中做了什么,但您可能尝试将查询中的实体从一个数据存储区实例保存到另一个数据存储区实例。麻烦的是数据存储区实例id嵌入在每个密钥中。所以(作为一个起点)你应该使用查询结果中的属性创建新的实体对象并保存它们。