Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not handle object of objects #9

Closed
joemastersemison opened this issue Feb 21, 2016 · 4 comments
Closed

Does not handle object of objects #9

joemastersemison opened this issue Feb 21, 2016 · 4 comments
Assignees

Comments

@joemastersemison
Copy link

I have a large (~2GB) JSON file that is a backup of a Firebase database. It is arranged as an object of objects (e.g.: {"objectA": {}, "objectB": [{},{}], "objectC": {}} ). When I import with pgfutter, I get "0 rows imported", even though pgfutter does seem to go through the whole file fairly quickly (less than 2 minutes).

I have experimented with trying to split the file with jq and writing my own stream-parsing code, but none of it seems to give me anything I can actually import properly with pgfutter. Can you help please?

@lukasmartinelli
Copy link
Owner

I would recommend using jq to split the object into several objects because you want to do that anyway if you want to bring your data into a good format. And it might be easier to do in jq than in SQL with the JSON operators.

Nontheless I implemented importing JSON objects in the latest v0.4 version. Check out whether that works for you.

https://github.com/lukasmartinelli/pgfutter#import-single-json-object
I do load the entire object into memory (I know kinda bad - but perhaps that still works for you).
The SQL API does not let me work with bytes directly, I need to pass the value when commiting the transaction I cannot work with streams - from what I know now.

@lukasmartinelli
Copy link
Owner

This feature has been released in v0.4.

pgfutter jsonobj document.json

@buildbreakdo
Copy link

buildbreakdo commented Apr 27, 2018

What does this command do? There is no CLI output or database record..

pgfutter jsonobj document.json

@lukasmartinelli
Copy link
Owner

It should create a database record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants