Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
074bb67b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
074bb67b
编写于
11月 12, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10979]fix int64 overflow issue
上级
730e91d4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
12 deletion
+15
-12
src/query/inc/qFill.h
src/query/inc/qFill.h
+1
-1
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+5
-5
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/query/src/qFill.c
src/query/src/qFill.c
+7
-4
未找到文件。
src/query/inc/qFill.h
浏览文件 @
074bb67b
...
...
@@ -86,7 +86,7 @@ bool taosFillHasMoreResults(SFillInfo* pFillInfo);
int64_t
getNumOfResultsAfterFillGap
(
SFillInfo
*
pFillInfo
,
int64_t
ekey
,
int32_t
maxNumOfRows
);
int32_t
taosGetLinearInterpolationVal
(
SPoint
*
point
,
int32_t
outputType
,
SPoint
*
point1
,
SPoint
*
point2
,
int32_t
inputType
,
bool
*
exceedMax
);
int32_t
taosGetLinearInterpolationVal
(
SPoint
*
point
,
int32_t
outputType
,
SPoint
*
point1
,
SPoint
*
point2
,
int32_t
inputType
,
bool
*
exceedMax
,
bool
*
exceedMin
);
int64_t
taosFillResultDataBlock
(
SFillInfo
*
pFillInfo
,
void
**
output
,
int32_t
capacity
);
...
...
src/query/src/qAggMain.c
浏览文件 @
074bb67b
...
...
@@ -3950,14 +3950,14 @@ static void interp_function(SQLFunctionCtx *pCtx) {
if
(
isNull
((
char
*
)
&
pCtx
->
start
.
val
,
srcType
)
||
isNull
((
char
*
)
&
pCtx
->
end
.
val
,
srcType
))
{
setNull
(
pCtx
->
pOutput
,
srcType
,
pCtx
->
inputBytes
);
}
else
{
bool
exceedMax
=
false
;
taosGetLinearInterpolationVal
(
&
point
,
pCtx
->
outputType
,
&
point1
,
&
point2
,
TSDB_DATA_TYPE_DOUBLE
,
&
exceedMax
);
if
(
exceedMax
)
{
bool
exceedMax
=
false
,
exceedMin
=
false
;
taosGetLinearInterpolationVal
(
&
point
,
pCtx
->
outputType
,
&
point1
,
&
point2
,
TSDB_DATA_TYPE_DOUBLE
,
&
exceedMax
,
&
exceedMin
);
if
(
exceedMax
||
exceedMin
)
{
__compar_fn_t
func
=
getComparFunc
((
int32_t
)
pCtx
->
inputType
,
0
);
if
(
func
(
&
pCtx
->
start
.
val
,
&
pCtx
->
end
.
val
)
<=
0
)
{
COPY_TYPED_DATA
(
pCtx
->
pOutput
,
pCtx
->
inputType
,
&
pCtx
->
start
.
val
);
COPY_TYPED_DATA
(
pCtx
->
pOutput
,
pCtx
->
inputType
,
exceedMax
?
&
pCtx
->
start
.
val
:
&
pCtx
->
end
.
val
);
}
else
{
COPY_TYPED_DATA
(
pCtx
->
pOutput
,
pCtx
->
inputType
,
&
pCtx
->
end
.
val
);
COPY_TYPED_DATA
(
pCtx
->
pOutput
,
pCtx
->
inputType
,
exceedMax
?
&
pCtx
->
end
.
val
:
&
pCtx
->
start
.
val
);
}
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
074bb67b
...
...
@@ -1303,8 +1303,8 @@ void doTimeWindowInterpolation(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo,
SPoint
point2
=
(
SPoint
){.
key
=
curTs
,
.
val
=
&
v2
};
SPoint
point
=
(
SPoint
){.
key
=
windowKey
,
.
val
=
&
v
};
bool
exceedMax
=
false
;
taosGetLinearInterpolationVal
(
&
point
,
TSDB_DATA_TYPE_DOUBLE
,
&
point1
,
&
point2
,
TSDB_DATA_TYPE_DOUBLE
,
&
exceedMax
);
bool
exceedMax
=
false
,
exceedMin
=
false
;
taosGetLinearInterpolationVal
(
&
point
,
TSDB_DATA_TYPE_DOUBLE
,
&
point1
,
&
point2
,
TSDB_DATA_TYPE_DOUBLE
,
&
exceedMax
,
&
exceedMin
);
if
(
type
==
RESULT_ROW_START_INTERP
)
{
pCtx
[
k
].
start
.
key
=
point
.
key
;
...
...
src/query/src/qFill.c
浏览文件 @
074bb67b
...
...
@@ -118,11 +118,11 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, void** data, char** srcData
continue
;
}
bool
exceedMax
=
false
;
bool
exceedMax
=
false
,
exceedMin
=
false
;
point1
=
(
SPoint
){.
key
=
*
(
TSKEY
*
)(
prev
),
.
val
=
prev
+
pCol
->
col
.
offset
};
point2
=
(
SPoint
){.
key
=
ts
,
.
val
=
srcData
[
i
]
+
pFillInfo
->
index
*
bytes
};
point
=
(
SPoint
){.
key
=
pFillInfo
->
currentKey
,
.
val
=
val1
};
taosGetLinearInterpolationVal
(
&
point
,
type
,
&
point1
,
&
point2
,
type
,
&
exceedMax
);
taosGetLinearInterpolationVal
(
&
point
,
type
,
&
point1
,
&
point2
,
type
,
&
exceedMax
,
&
exceedMin
);
}
}
else
{
setNullValueForRow
(
pFillInfo
,
data
,
pFillInfo
->
numOfCols
,
index
);
...
...
@@ -494,15 +494,18 @@ int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t ma
return
(
numOfRes
>
maxNumOfRows
)
?
maxNumOfRows
:
numOfRes
;
}
int32_t
taosGetLinearInterpolationVal
(
SPoint
*
point
,
int32_t
outputType
,
SPoint
*
point1
,
SPoint
*
point2
,
int32_t
inputType
,
bool
*
exceedMax
)
{
double
v1
=
-
1
,
v2
=
-
1
,
vmax
=
-
1
;
int32_t
taosGetLinearInterpolationVal
(
SPoint
*
point
,
int32_t
outputType
,
SPoint
*
point1
,
SPoint
*
point2
,
int32_t
inputType
,
bool
*
exceedMax
,
bool
*
exceedMin
)
{
double
v1
=
-
1
,
v2
=
-
1
,
vmax
=
-
1
,
vmin
=
-
1
;
GET_TYPED_DATA
(
v1
,
double
,
inputType
,
point1
->
val
);
GET_TYPED_DATA
(
v2
,
double
,
inputType
,
point2
->
val
);
GET_TYPED_DATA
(
vmax
,
double
,
outputType
,
getDataMax
(
outputType
));
GET_TYPED_DATA
(
vmin
,
double
,
outputType
,
getDataMin
(
outputType
));
double
r
=
DO_INTERPOLATION
(
v1
,
v2
,
point1
->
key
,
point2
->
key
,
point
->
key
);
if
(
r
>=
vmax
)
{
*
exceedMax
=
true
;
}
else
if
(
r
<=
vmin
)
{
*
exceedMin
=
true
;
}
SET_TYPED_DATA
(
point
->
val
,
outputType
,
r
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录