From 0d98e2480148ff7e432febe77b74597fa6cfc998 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 13 Jan 2021 10:31:05 +0800 Subject: [PATCH] [TD-225]fix compiler error. --- src/query/src/qPercentile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/query/src/qPercentile.c b/src/query/src/qPercentile.c index 9d4dde2207..3178319ce8 100644 --- a/src/query/src/qPercentile.c +++ b/src/query/src/qPercentile.c @@ -119,7 +119,7 @@ int32_t tBucketIntHash(tMemBucket *pBucket, const void *value) { // divide the value range into 1024 buckets uint64_t span = pBucket->range.i64MaxVal - pBucket->range.i64MinVal; if (span < pBucket->numOfSlots) { - int32_t delta = v - pBucket->range.i64MinVal; + int64_t delta = v - pBucket->range.i64MinVal; index = (delta % pBucket->numOfSlots); } else { double slotSpan = (double)span / pBucket->numOfSlots; @@ -141,8 +141,8 @@ int32_t tBucketUintHash(tMemBucket *pBucket, const void *value) { // divide the value range into 1024 buckets uint64_t span = pBucket->range.u64MaxVal - pBucket->range.u64MinVal; if (span < pBucket->numOfSlots) { - int32_t delta = v - pBucket->range.u64MinVal; - index = (delta % pBucket->numOfSlots); + int64_t delta = v - pBucket->range.u64MinVal; + index = (int32_t) (delta % pBucket->numOfSlots); } else { double slotSpan = (double)span / pBucket->numOfSlots; index = (int32_t)((v - pBucket->range.u64MinVal) / slotSpan); @@ -515,4 +515,4 @@ bool isIdenticalData(tMemBucket *pMemBucket, int32_t index) { } else { return pSeg->range.i64MinVal == pSeg->range.i64MaxVal; } -} \ No newline at end of file +} -- GitLab