Hi..

The Bulkloader works really smooth for me... but I have some important
questions.

I have downloaded data from a GAE/Python App which I wish to use in a
GAE/Java App.

I am having trouble with converting Entities with String Keys (python)
to Entities with Long as Keys (java).

My Questions:
- How to convert keys from String to Long ?
- What are the best practices when migrating data within GAE from
python version to Java?

Any advice will be really helpful.
Thanks
C30



On May 25, 1:01 am, Matthew Blain <[email protected]> wrote:
> At the moment the bulkloader does not support numeric keys as the
> entity key. The main reason for this is that numeric ids are designed
> to be managed by the datastore, not be user-generated. You may wish to
> add an additional property to your entity kind which you can sort on.
>
> However we are aware of this. You will need to specify a numeric key
> in the transform (e.g. import_transform: lambda x:
> datastore.Key.from_path(kind, int(x))). We also need to change the
> bulkloader to handle both the creation of an entity with a numeric key
> and more importantly figuring out how to tell the datastore's id
> generation code that we've done this.
>
> --Matthew
>
> On May 24, 9:53 am, Craig Berry <[email protected]> wrote:
>
>
>
>
>
> > Can someone help me with this, please? I'm sure the answer is trivial,
> > but another weekend of tinkering hasn't led me to the solution.
>
> > On Fri, May 21, 2010 at 20:21, Craig Berry <[email protected]> wrote:
> > > I have an xml file containing data which I wish to bulkupload to GAE.
> > > I am using the preview version of the new bulk uploader, if that
> > > matters. How do I include an int value for the __key__ derived from a
> > > field in the xml data? If I specify no import transform, like so
>
> > >    - property: __key__
> > >      external_name: id
> > >      export_transform: transform.key_id_or_name_as_string
>
> > > it loads the key as a string 'name', so it sorts lexicographically
> > > rather than numerically. I want an int id instead. But I can't find
> > > what to put in as an import_transform to make this happen.
>
> > > Thanks in advance for any help on this.
>
> > > --
> > > Craig Berry -http://lapidum.org/home.html
> > > "Magicians lie to the universe, and the
> > > universe believes them."  -- Lenore Berry
>
> > --
> > Craig Berry -http://lapidum.org/home.html
> > "Magicians lie to the universe, and the
> > universe believes them."  -- Lenore Berry
>
> > --
> > 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 
> 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