Hi Songlin!
It's great that you are excited about this project! Here are my thoughts on your proposal and what I think you should focus on:
JSON_NORMALIZE seems simple at first, but I believe there are a lot of corner cases. In order to get a proper specification for this function can you have a look at other databases, to see if they implement something similar? Have a look at the pandas python library, can you learn from their experience?
Normalizing JSON can have some tricky cases such as:
a. How are arrays sorted if the values inside them are a mix of objects, arrays, literals, numbers.
b. How do you define a sorting criteria between two JSON objects in this case?
c. JSON is represented as text, however one can use it to store floating point values. How do you plan to compare doubles and how would those values be sorted? For example: 1 vs 1.0 vs 1.00 or 1000 vs 1e3?
d. What's the priority of null values, are they first, last?
The way we should handle this project is via TDD (Test Driven Development). You would first write your test cases, covering as many corner cases as possible, then implement the code such that it passes all the tests.
I suggest you add to your proposal some examples of how you define JSON_NORMALIZE and JSON_EQUALS to behave, so that we can see you have thought about points a, b, c, d from above.
As for JSON_EQUALS, assuming JSON_NORMALIZE is done correctly, it may work as a simple strcmp between two normalized JSON objects, but I am not 100% confident at this point, you would have to prove it :)
Vicențiu