Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e9f79254
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看板
提交
e9f79254
编写于
8月 08, 2022
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: merge spread into output when input spread has result
上级
07b88a35
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
6 deletion
+9
-6
include/common/ttypes.h
include/common/ttypes.h
+0
-2
include/libs/function/function.h
include/libs/function/function.h
+1
-1
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+8
-3
未找到文件。
include/common/ttypes.h
浏览文件 @
e9f79254
...
@@ -354,8 +354,6 @@ void operateVal(void *dst, void *s1, void *s2, int32_t optr, int32_t type);
...
@@ -354,8 +354,6 @@ void operateVal(void *dst, void *s1, void *s2, int32_t optr, int32_t type);
void
*
getDataMin
(
int32_t
type
);
void
*
getDataMin
(
int32_t
type
);
void
*
getDataMax
(
int32_t
type
);
void
*
getDataMax
(
int32_t
type
);
#define SET_DOUBLE_NULL(v) (*(uint64_t *)(v) = TSDB_DATA_DOUBLE_NULL)
#define SET_BIGINT_NULL(v) (*(uint64_t *)(v) = TSDB_DATA_BIGINT_NULL)
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
include/libs/function/function.h
浏览文件 @
e9f79254
...
@@ -67,7 +67,7 @@ typedef struct SResultRowEntryInfo {
...
@@ -67,7 +67,7 @@ typedef struct SResultRowEntryInfo {
bool
initialized
:
1
;
// output buffer has been initialized
bool
initialized
:
1
;
// output buffer has been initialized
bool
complete
:
1
;
// query has completed
bool
complete
:
1
;
// query has completed
uint8_t
isNullRes
:
6
;
// the result is null
uint8_t
isNullRes
:
6
;
// the result is null
uint16_t
numOfRes
;
// num of output result in current buffer
uint16_t
numOfRes
;
// num of output result in current buffer
. NOT NULL RESULT
}
SResultRowEntryInfo
;
}
SResultRowEntryInfo
;
// determine the real data need to calculated the result
// determine the real data need to calculated the result
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
e9f79254
...
@@ -3845,14 +3845,17 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -3845,14 +3845,17 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
SSpreadInfo
*
pInfo
=
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
SSpreadInfo
*
pInfo
=
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SSpreadInfo
*
pInputInfo
=
(
SSpreadInfo
*
)
varDataVal
(
data
);
SSpreadInfo
*
pInputInfo
=
(
SSpreadInfo
*
)
varDataVal
(
data
);
spreadTransferInfo
(
pInputInfo
,
pInfo
);
if
(
pInputInfo
->
hasResult
)
{
spreadTransferInfo
(
pInputInfo
,
pInfo
);
}
}
}
SET_VAL
(
GET_RES_INFO
(
pCtx
),
1
,
1
);
if
(
pInfo
->
hasResult
)
{
GET_RES_INFO
(
pCtx
)
->
numOfRes
=
1
;
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -3861,6 +3864,8 @@ int32_t spreadFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
...
@@ -3861,6 +3864,8 @@ int32_t spreadFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
SSpreadInfo
*
pInfo
=
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
SSpreadInfo
*
pInfo
=
GET_ROWCELL_INTERBUF
(
GET_RES_INFO
(
pCtx
));
if
(
pInfo
->
hasResult
==
true
)
{
if
(
pInfo
->
hasResult
==
true
)
{
SET_DOUBLE_VAL
(
&
pInfo
->
result
,
pInfo
->
max
-
pInfo
->
min
);
SET_DOUBLE_VAL
(
&
pInfo
->
result
,
pInfo
->
max
-
pInfo
->
min
);
}
else
{
GET_RES_INFO
(
pCtx
)
->
isNullRes
=
1
;
}
}
return
functionFinalize
(
pCtx
,
pBlock
);
return
functionFinalize
(
pCtx
,
pBlock
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录