SharonIV0x86 commented on code in PR #2849:
URL: https://github.com/apache/kvrocks/pull/2849#discussion_r2071648604
##########
tests/gocase/unit/type/tdigest/tdigest_test.go:
##########
@@ -310,4 +311,43 @@ func tdigestTests(t *testing.T, configs
util.KvrocksServerConfigs) {
infoAfterEmptyReset := toTdigestInfo(t, rsp.Val())
require.EqualValues(t, 100, infoAfterEmptyReset.Compression)
})
+ t.Run("tdigest.quantile with different arguments", func(t *testing.T) {
+ keyPrefix := "t_qt_"
+
+ //Testing with no arguments
+ require.ErrorContains(t, rdb.Do(ctx, "TDIGEST.QUANTILE").Err(),
errMsgWrongNumberArg)
+
+ // Quantile on a non existent key
+ require.ErrorContains(t, rdb.Do(ctx, "TDIGEST.QUANTILE",
keyPrefix+"iDoNotExist").Err(), errMsgKeyNotExist)
+
+ // Creating a key
+ require.NoError(t, rdb.Do(ctx, "TDIGEST.CREATE",
keyPrefix+"01", "compression", "100").Err())
+
+ key := keyPrefix + "01"
+ //Adding some data to tdigest 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
+ require.NoError(t, rdb.Do(ctx, "TDIGEST.ADD", key, "1", "2",
"2", "3", "3", "3", "4", "4", "4", "4", "5", "5", "5", "5", "5").Err())
Review Comment:
Sure will do that.
--
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]