WEEK 6: ENTRY 2
Today at my internship, I was tasked at converting the json data format that my big query returns. My query from Big Query API returns a Json response body. Unlike the regular json array data I have seen previously, this json was different because first it has some schema metadata that I don’t need in my response body. The json data also is nested with each key in each map having the same key name, let say “v.” For me, this was the biggest challenge I have had with manipulating json data.
So how did it go for me? Well, I must say that it is really tedious. I first of all had to read more on manipulating nested json data and then use the Go programming language to do the conversion. After reading a couple of articles, I got an idea that I could use a Go package, unmarshall, to modify the json data. From the stack overflow solution I found, the unmarshall package was used for very simple json data: key: value pair map data type. Thus, to mimic that approach was very unlikely to resolve my problem. I tried it on my codebase but it did not work at all. I also tried going through the other articles my manager sent me but it did not work out as well. Until now, I’m having trouble unmarshalling the json data I got from Big Query.
As I am writing this blog, I felt like I was so naive that I did not try using the Go playground online IDE and create a replica of my data and use the unmarshall function to test out my logic. So too, I could have saved a lot of time if I had consulted by buddy and see what their approach or suggestion could be with this issue. Therefore, I’m scheduling a meeting with my buddy first thing tomorrow; however, I will try using the Go playground online and try out my replica data that way it would speed up the debugging process with my logic.
Comments
Post a Comment