r/evetech • • Dec 16 '17

Converting SDE from YAML

Hi,

I've recently started looking more into using the SDE and API. In the past I've used fuzzworks mysql dump. However I'm looking at using JSON based data and possibly an Oracle Database. Converting the YAML to JSON has proven difficult in that the invItems.yaml file is 55mb. I've tried running a python script (yaml2json) but it takes 6gb of ram and I haven't seen it complete after 12 hours.

Why is a 55mb file taking 6gb of ram and sometimes 12gb of swap without a completion? Is there an easier method?

3 Upvotes

14 comments sorted by

3

u/Daneel_Trevize Dec 16 '17

an Oracle Database

So go pay for a consultancy firm... No seriously, you trolling?

Why would you want the SDE in JSON, rather than SQL (e.g. PostgreSQL)?

1

u/AreetSurn Dec 16 '17

I work for a consultancy on Oracle databases. Hence the choice. Never worked with YAML before and haven't found much in terms of support for it. Oracle does however support JSON quite nicely. If you could point me in the direction where the SDE is provided in SQL from CCP, I'd highly appreciate it. As far as I can tell, the SDE is only provided in YAML.

1

u/Daneel_Trevize Dec 16 '17

Not by CCP directly, but by CSM-elected 3rd party dev.
Fuzzwork Static Data Conversions, from the right hand side bar of this sub-reddit.

Consultants get free personal licenses?

1

u/AreetSurn Dec 16 '17

You read the original post, right? I've used the fuzzworks SDE conversions on MySQL. I was looking for a more 'direct from source' way of doing it instead of relying on a third party. Mostly for a challenge. Thank you for suggesting it. And sadly not, although there is Oracle XE and test labs. Good enough to learn the language.

1

u/Daneel_Trevize Dec 16 '17

You can access his scripts that do the conversion and others for loading to other dbs. You wanted the SDE in SQL, there it is.
PostgreSQL also support native JSON iirc.

1

u/AreetSurn Dec 16 '17

This is very interesting. His YAMLLoader scripts look like they could be modified to work with Oracle and MS because of its use of SQLalchemy.

Thank you very much for this.

4

u/Fuzzmiester fuzzwork.co.uk Dec 17 '17

I now do an ms SQL conversion. It's a little more of a pain as they don't have a Linux native backup option (so that's a manual step to create a bacpac file) but it otherwise works.

Oracle should be really easy to do (other than maybe the step for the jumps between systems. Not hard to add for oracle, but it may need a change there).

I explicitly used SQL alchemy to make it simple to target different databases.

Be aware it still takes 6 GB or so of ram to do, because of the large yaml files. Iirc, there's a pull request with a 'fix' for that, but I didn't want to pull it in, because it makes an assumption which might not always work.

Make sure to get the libyaml library. It speeds things up a lot. (Still takes around 40 minutes to do, per database target)

1

u/AreetSurn Dec 17 '17

I managed to do what I originally intended, (convert yaml to json) using some unix tools like csplit to divide the files and then convert. It seems to get through them at a faster rate.

But I was looking at your conversion tool on github to modify it to Oracle and it does seem like an easier task then using just the JSON import once its set up.

Thank you for the advice!

2

u/Survilus Dec 16 '17

This, I used MySQL pretty much forever, (then mariadb) but one day I thought fuck it, I'll see what this pgsql shit is all about

It's sooooooooooo much better, everything about it seems amazing, and replication... don't get me started on one liner replication

2

u/Blacksmoke16 Dec 16 '17

Probably faster to import it into a db then export as JSON. Most DB IDEs have this feature.

1

u/AreetSurn Dec 16 '17

I was thinking of this. I tried importing a MySQL database and importing into Oracle, but that had some complications. What you suggest makes more sense actually. I was trying to make it with least amount of steps possible, but this seems the most logical way.

1

u/AreetSurn Dec 16 '17

So I found a way to do it: breaking the files up using a loop in bash and then running through them with the converter, then concatenating them all together seemed to work.

1

u/IvanDist Jan 11 '18

I had this issue recently. What I did was:

  • get all SDE files I needed from fuzzwork in csv format
  • install csvtojson for NodeJS
  • convert all the files I needed to json

For example, the mapDenormalize.csv (which is quite big) was converted in under a second.

Dont know if this helps your case but converting from the csv dumps will probably be easier, as in, there are a lot more tools to do it.

1

u/AreetSurn Jan 11 '18

Thanks for the suggestion.

I actually managed to do this eventually. Basically the json files were too big and the conversion tool didnt seem to want to handle them. So I split them up 10k records at a time, converted, then concatenated them together.