Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d4d210af
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
d4d210af
编写于
4月 06, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-14493] support distinct.
上级
6f26d177
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
5 deletion
+11
-5
include/libs/function/function.h
include/libs/function/function.h
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+9
-3
未找到文件。
include/libs/function/function.h
浏览文件 @
d4d210af
...
...
@@ -113,7 +113,7 @@ typedef struct SResultRowEntryInfo {
int8_t
hasResult
;
// result generated, not NULL value
bool
initialized
;
// output buffer has been initialized
bool
complete
;
// query has completed
uint
32
_t
numOfRes
;
// num of output result in current buffer
uint
16
_t
numOfRes
;
// num of output result in current buffer
}
SResultRowEntryInfo
;
// determine the real data need to calculated the result
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
d4d210af
...
...
@@ -976,7 +976,7 @@ void doApplyFunctions(SqlFunctionCtx* pCtx, STimeWindow* pWin, SColumnInfoData*
for
(
int32_t
k
=
0
;
k
<
numOfOutput
;
++
k
)
{
pCtx
[
k
].
startTs
=
pWin
->
skey
;
// keep it temporari
a
ly
// keep it temporarily
bool
hasAgg
=
pCtx
[
k
].
input
.
colDataAggIsSet
;
int32_t
numOfRows
=
pCtx
[
k
].
input
.
numOfRows
;
int32_t
startOffset
=
pCtx
[
k
].
input
.
startRowIndex
;
...
...
source/libs/executor/src/groupoperator.c
浏览文件 @
d4d210af
...
...
@@ -106,7 +106,7 @@ static bool groupKeyCompare(SGroupbyOperatorInfo* pInfo, SSDataBlock* pBlock, in
return
true
;
}
static
void
keep
GroupKeys
(
SGroupbyOperatorInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
rowIndex
,
int32_t
numOfGroupCols
)
{
static
void
record
GroupKeys
(
SGroupbyOperatorInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
rowIndex
,
int32_t
numOfGroupCols
)
{
SColumnDataAgg
*
pColAgg
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
numOfGroupCols
;
++
i
)
{
...
...
@@ -197,7 +197,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
for
(
int32_t
j
=
0
;
j
<
pBlock
->
info
.
rows
;
++
j
)
{
// Compare with the previous row of this column, and do not set the output buffer again if they are identical.
if
(
!
pInfo
->
isInit
)
{
keep
GroupKeys
(
pInfo
,
pBlock
,
j
,
numOfGroupCols
);
record
GroupKeys
(
pInfo
,
pBlock
,
j
,
numOfGroupCols
);
pInfo
->
isInit
=
true
;
num
++
;
continue
;
...
...
@@ -209,6 +209,12 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
continue
;
}
if
(
!
equal
&&
j
==
0
)
{
num
++
;
recordGroupKeys
(
pInfo
,
pBlock
,
j
,
numOfGroupCols
);
continue
;
}
/*int32_t ret = */
generatedHashKey
(
pInfo
->
keyBuf
,
&
len
,
pInfo
->
pGroupColVals
);
int32_t
ret
=
setGroupResultOutputBuf_rv
(
&
(
pInfo
->
binfo
),
pOperator
->
numOfOutput
,
pInfo
->
keyBuf
,
TSDB_DATA_TYPE_VARCHAR
,
len
,
0
,
pInfo
->
aggSup
.
pResultBuf
,
pTaskInfo
,
&
pInfo
->
aggSup
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
// null data, too many state code
...
...
@@ -220,7 +226,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
// assign the group keys or user input constant values if required
doAssignGroupKeys
(
pCtx
,
pOperator
->
numOfOutput
,
pBlock
->
info
.
rows
,
rowIndex
);
keep
GroupKeys
(
pInfo
,
pBlock
,
j
,
numOfGroupCols
);
record
GroupKeys
(
pInfo
,
pBlock
,
j
,
numOfGroupCols
);
num
=
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录