datafuselabs / jsonb

JSONB implement in rust
Apache License 2.0
62 stars 8 forks source link

feat: strip_nulls api #30

Closed akoshchiy closed 1 year ago

akoshchiy commented 1 year ago

Added strip_nulls, related with https://github.com/datafuselabs/databend/issues/11270.

akoshchiy commented 1 year ago

Is it ok to implement this using decoder/encoder api? As I see, other functions prefer to decode manually, as it's more performant as I suppose.

b41sh commented 1 year ago

Is it ok to implement this using decoder/encoder api? As I see, other functions prefer to decode manually, as it's more performant as I suppose.

I think it's ok to use decoder/encoder API. Manual decode can speed up execution by processing only the parts that are needed and skipping some other parts, but of course it's a little bit more complicated to implement this way. As the strip_nulls function is used relatively rarely, I think we can forget about performance and use decoder/encoder API to make the code simpler.