Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2fdda137
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2fdda137
编写于
1月 13, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225]fix compiler error.
上级
0d98e248
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
15 deletion
+14
-15
src/query/src/qPercentile.c
src/query/src/qPercentile.c
+14
-15
未找到文件。
src/query/src/qPercentile.c
浏览文件 @
2fdda137
...
...
@@ -12,13 +12,12 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include "qPercentile.h"
#include "qResultbuf.h"
#include "os.h"
#include "queryLog.h"
#include "taosdef.h"
#include "tulog.h"
#include "tcompare.h"
#include "ttype.h"
...
...
@@ -218,7 +217,7 @@ tMemBucket *tMemBucketCreate(int16_t nElemSize, int16_t dataType, double minval,
pBucket
->
maxCapacity
=
200000
;
if
(
setBoundingBox
(
&
pBucket
->
range
,
pBucket
->
type
,
minval
,
maxval
)
!=
0
)
{
u
Error
(
"MemBucket:%p, invalid value range: %f-%f"
,
pBucket
,
minval
,
maxval
);
q
Error
(
"MemBucket:%p, invalid value range: %f-%f"
,
pBucket
,
minval
,
maxval
);
free
(
pBucket
);
return
NULL
;
}
...
...
@@ -228,7 +227,7 @@ tMemBucket *tMemBucketCreate(int16_t nElemSize, int16_t dataType, double minval,
pBucket
->
hashFunc
=
getHashFunc
(
pBucket
->
type
);
if
(
pBucket
->
hashFunc
==
NULL
)
{
u
Error
(
"MemBucket:%p, not support data type %d, failed"
,
pBucket
,
pBucket
->
type
);
q
Error
(
"MemBucket:%p, not support data type %d, failed"
,
pBucket
,
pBucket
->
type
);
free
(
pBucket
);
return
NULL
;
}
...
...
@@ -247,7 +246,7 @@ tMemBucket *tMemBucketCreate(int16_t nElemSize, int16_t dataType, double minval,
return
NULL
;
}
u
Debug
(
"MemBucket:%p, elem size:%d"
,
pBucket
,
pBucket
->
bytes
);
q
Debug
(
"MemBucket:%p, elem size:%d"
,
pBucket
,
pBucket
->
bytes
);
return
pBucket
;
}
...
...
@@ -371,11 +370,11 @@ static double getIdenticalDataVal(tMemBucket* pMemBucket, int32_t slotIndex) {
double
finalResult
=
0
.
0
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
pMemBucket
->
type
))
{
finalResult
=
pSlot
->
range
.
i64MinVal
;
finalResult
=
(
double
)
pSlot
->
range
.
i64MinVal
;
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
pMemBucket
->
type
))
{
finalResult
=
pSlot
->
range
.
u64MinVal
;
finalResult
=
(
double
)
pSlot
->
range
.
u64MinVal
;
}
else
{
finalResult
=
pSlot
->
range
.
dMinVal
;
finalResult
=
(
double
)
pSlot
->
range
.
dMinVal
;
}
return
finalResult
;
...
...
@@ -402,14 +401,14 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction)
double
maxOfThisSlot
=
0
;
double
minOfNextSlot
=
0
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
pMemBucket
->
type
))
{
maxOfThisSlot
=
pSlot
->
range
.
i64MaxVal
;
minOfNextSlot
=
next
.
i64MinVal
;
maxOfThisSlot
=
(
double
)
pSlot
->
range
.
i64MaxVal
;
minOfNextSlot
=
(
double
)
next
.
i64MinVal
;
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
pMemBucket
->
type
))
{
maxOfThisSlot
=
pSlot
->
range
.
u64MaxVal
;
minOfNextSlot
=
next
.
u64MinVal
;
maxOfThisSlot
=
(
double
)
pSlot
->
range
.
u64MaxVal
;
minOfNextSlot
=
(
double
)
next
.
u64MinVal
;
}
else
{
maxOfThisSlot
=
pSlot
->
range
.
dMaxVal
;
minOfNextSlot
=
next
.
dMinVal
;
maxOfThisSlot
=
(
double
)
pSlot
->
range
.
dMaxVal
;
minOfNextSlot
=
(
double
)
next
.
dMinVal
;
}
assert
(
minOfNextSlot
>
maxOfThisSlot
);
...
...
@@ -441,7 +440,7 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction)
// try next round
pMemBucket
->
times
+=
1
;
u
Debug
(
"MemBucket:%p, start next round data bucketing, time:%d"
,
pMemBucket
,
pMemBucket
->
times
);
q
Debug
(
"MemBucket:%p, start next round data bucketing, time:%d"
,
pMemBucket
,
pMemBucket
->
times
);
pMemBucket
->
range
=
pSlot
->
range
;
pMemBucket
->
total
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录