S3tuit commented on issue #5755:
URL: https://github.com/apache/hop/issues/5755#issuecomment-3365999408
@mattcasters @hansva I’d like to read your (or any other dev) opinion.
Should Hop’s JSON type behave more like PostgreSQL JSON or JSONB?
### Option A — JSON similar to Postgres JSON
This keeps key order and duplicate keys. Equality/sort are textual, so two
objects with the same keys/values in different orders are considered different.
This is easier to implement and a bit fastest at ingestion... but also slower
when sorting/comparing (since it should be converted back to String) and will
have limited interoperability. For example, these two values even if equals
will be treated as different:
```
{"name":"a","num":1}
{"num":1,"name":"a"}
```
### Option B — JSON similar to Postgres JSONB
In this implementation, keys will be sorted at ingestion (or object key
order is irrelevant), duplicates are normalized by last key wins. This will be
a much better fir for handling and writing/reading JSON values, faster for most
operations but also more costly at ingestion. In this implementation the two
JSON values of the prev example are treated as equals. I also expect this to be
not so easy to implement and there are many things I'll have to think and test.
I think option B would be better... or, we can also treat the current JSON
as option A and then add a plugin type for JSONB.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]