Using .net 4.8 I need to import a large (7GB+) unstructured Json file into SQL Server.
Yes, 7GB is correct and yes, I know this is not ideal, but this is the problem that landed on my plate. Please don't comment on why I'm trying to take bad unstructured data into a structured database or why I'm doing this. I have a plan to make this clean, good, structured data. For now, I just need to solve this problem. This problem is a one-time occurance - thanks.
By saying "unstructured", it looks like the screenshot below where the top level elements are GUIDs or user names (all unique) and the data structures under those are inconsistent. Therefore I can not create a type to de-serialize to custom class like:
o = serializer.Deserialize<MyObject>(reader);
I can, however, get a list of all the top level elements like this (by just copy/paste from the firebase web page to a c# console app) and loop through items, use each item's text to do a fetch or query into the large json file to get their json:
Then perhaps from c# I could query the blob of json and pull all data for each element one at a time keeping in mind that I won't be able use a class like "MyObject" to deserialize like this:
o = serializer.Deserialize<MyObject>(reader);
My goal is to get the json for each top element, then loop through its' child elements: issues projects images reports etc.
Then for each of those, do the same, loop through their child elements, etc. For every element, as long as I know what type of element it is and what it's parent element is, then I will know how to insert it into sql server.
Another problem I have is reading the json file into a string variable I get a system out of memory exception
using (StreamReader streamReader = new StreamReader(path, Encoding.UTF8))
{
readContents = streamReader.ReadToEnd();
}
Thank you for any help you can offer.