Let me explain once again if I missed something earlier. I have an
existing task management application & wants to shift it now to google
app engine. While I tried porting my existing data into google app
engine using BulkLoader 1.3.5 with csv file, all my IDs saved as
string (not as long). Suppose I was having a user with id=1 (long), it
uploaded into google app engine with name=1(String). Now when I am
saving new records directly on google app engine using my application
running on google app engine, it saves an another record with
id=1(this time it's long). So it's not possible for me to identifiy b/
w these two records (one with id=1 & another with name=1).

I hope a lot of people are using BulkLoader API for uploading existing
data to GAE & Google also recommend this API, so it should not have
such a basic bug at this level.

Any help/suggestion in this regard will be highly appreciated

On Jul 14, 6:08 am, John Patterson <[email protected]> wrote:
> You can do this now using the RemoteDatastore Java utility
>
> http://code.google.com/p/remote-datastore/
>
> For example, this code runs on your desktop and creates a single  
> entity in your live datastore:
>
>     // divert datastore operations to live application
>     RemoteDatastore.install();
>     
> RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore
> ", "myApp", "myVersion");
>
>     // create an entity with a numeric key
>     Key key = KeyFactory.createKey("MyKindName, 35);
>     Entity entity1 = new Entity(key);
>     entity1.setProperty("property1", "hello");
>
>     // put entity to the remote datastore
>     DatastoreService service =  
> DatastoreServiceFactory.getDatastoreService();
>     datastore.put(entity1);
>
> This also works for bulk puts
>
> On 14 Jul 2010, at 03:37, Matthew Blain wrote:
>
>
>
> > Sorry, this won't be available until 1.3.6. You should be able to do
> > something like this:
>
> > - property: __key__
> >   external_name: CityId
> >   export_transform: datastore.Key.id
> >   import_transform: lambda value: datastore.Key.from_path('City',
> > int(value))
>
> > --Matthew
>
> > On Jul 10, 5:53 pm, Pasha <[email protected]> wrote:
> >> Could you please post an example. Thank you in advance.
>
> >> On Jun 30, 1:18 pm, Matthew Blain <[email protected]> wrote:
>
> >>> The 1.3.5 bulkloader client will allow you to specify a numeric key;
> >>> you must use the Key constructor explicitly to do this, integers  
> >>> will
> >>> still be converted into strings.
>
> >>> On Jun 30, 12:12 am, MANISH DHIMAN <[email protected]> wrote:
>
> >>>> Hi All
> >>>> When I upload data using CSV file on G A E. Primary key is stored
> >>>> there as a name instead of id.
> >>>> Example.
>
> >>>> Format of .yaml is Given below
> >>>> transformers:
> >>>> - kind: City
> >>>>   connector: csv
> >>>>   connector_options:
> >>>>     encoding: utf-8
> >>>>     columns: from_header
> >>>>   property_map:
> >>>>     - property: __key__
> >>>>       external_name: CityId
> >>>>       export_transform: datastore.Key.id
> >>>>     - property: Name
> >>>>       external_name: Name
>
> >>>> Primary key stored there is:
> >>>> ID/Name                   Name
> >>>> name=1                    Delhi
> >>>> name=2                    London
>
> >>>> Due to uploaded data with name=<keyvalue>, when I am try to get Key
> >>>> from any Fetched Entities, then Key contains only name value but id
> >>>> value is 0 and also name contains long value as a String instance.
>
> >>>> Is it possible to store primary key(Using CSV while uploading  
> >>>> data) in
> >>>> a format given below :
> >>>> ID/Name              Name
> >>>> id=1                    Delhi
> >>>> id=2                    London
>
> >>>> When data is stored with id=<keyvalue>, then Key contains id  
> >>>> value is
> >>>> <keyvalue> as long instance.
>
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to [email protected]
> > .
> > To unsubscribe from this group, send email to 
> > [email protected]
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to