LindaSummer commented on code in PR #2849:
URL: https://github.com/apache/kvrocks/pull/2849#discussion_r2079694487


##########
src/types/redis_tdigest.cc:
##########
@@ -225,6 +225,10 @@ rocksdb::Status TDigest::Quantile(engine::Context& ctx, 
const Slice& digest_name
   if (auto status = dumpCentroids(ctx, ns_key, metadata, &centroids); 
!status.ok()) {
     return status;
   }
+  if (centroids.empty()) {

Review Comment:
   Hi @SharonIV0x86 ,
   
   At the first time we load the metadata, we should know this tdigest has no 
data inside it.
   This could be checked before the centroids retrieving.
   
   And it would be better to add cpp unit test for this behavior.
   
   Best Regards,
   Edward
   



-- 
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]

Reply via email to