Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b250efee
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看板
提交
b250efee
编写于
8月 24, 2022
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: support window pseduo column for fill operator
上级
b62e0c02
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
121 addition
and
118 deletion
+121
-118
include/common/tcommon.h
include/common/tcommon.h
+1
-1
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+3
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+101
-97
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+0
-14
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+5
-0
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+2
-2
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+9
-3
未找到文件。
include/common/tcommon.h
浏览文件 @
b250efee
...
...
@@ -181,7 +181,7 @@ typedef struct SColumn {
int16_t
slotId
;
char
name
[
TSDB_COL_NAME_LEN
];
int
8_t
flag
;
// column type: normal column, tag, or user-input column (integer/float/string)
int
16_t
colType
;
// column type: normal column, tag, or window column
int16_t
type
;
int32_t
bytes
;
uint8_t
precision
;
...
...
include/libs/nodes/querynodes.h
浏览文件 @
b250efee
...
...
@@ -57,7 +57,9 @@ typedef enum EColumnType {
COLUMN_TYPE_COLUMN
=
1
,
COLUMN_TYPE_TAG
,
COLUMN_TYPE_TBNAME
,
COLUMN_TYPE_WINDOW_PC
,
COLUMN_TYPE_WINDOW_START
,
COLUMN_TYPE_WINDOW_END
,
COLUMN_TYPE_WINDOW_DURATION
,
COLUMN_TYPE_GROUP_KEY
}
EColumnType
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
b250efee
此差异已折叠。
点击以展开。
source/libs/executor/src/executorimpl.c
浏览文件 @
b250efee
...
...
@@ -148,20 +148,6 @@ static int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock,
static
void
initCtxOutputBuffer
(
SqlFunctionCtx
*
pCtx
,
int32_t
size
);
static
void
doSetTableGroupOutputBuf
(
SOperatorInfo
*
pOperator
,
int32_t
numOfOutput
,
uint64_t
groupId
);
// setup the output buffer for each operator
static
bool
hasNull
(
SColumn
*
pColumn
,
SColumnDataAgg
*
pStatis
)
{
if
(
TSDB_COL_IS_TAG
(
pColumn
->
flag
)
||
TSDB_COL_IS_UD_COL
(
pColumn
->
flag
)
||
pColumn
->
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
return
false
;
}
if
(
pStatis
!=
NULL
&&
pStatis
->
numOfNull
==
0
)
{
return
false
;
}
return
true
;
}
#if 0
static bool chkResultRowFromKey(STaskRuntimeEnv* pRuntimeEnv, SResultRowInfo* pResultRowInfo, char* pData,
int16_t bytes, bool masterscan, uint64_t uid) {
...
...
source/libs/executor/src/tfill.c
浏览文件 @
b250efee
...
...
@@ -76,6 +76,11 @@ static void doSetUserSpecifiedValue(SColumnInfoData* pDst, SVariant* pVar, int32
}
}
static
bool
fillWindowPseudoColumn
(
SFillInfo
*
pFillInfo
,
SFillColInfo
*
pCol
,
SColumnInfoData
*
pDstColInfoData
,
int32_t
rowIndex
)
{
//fill windows pseduo column, _wstart, _wend, _wduration and return true
return
false
;
}
static
void
doFillOneRow
(
SFillInfo
*
pFillInfo
,
SSDataBlock
*
pBlock
,
SSDataBlock
*
pSrcBlock
,
int64_t
ts
,
bool
outOfBound
)
{
SPoint
point1
,
point2
,
point
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
b250efee
...
...
@@ -1918,8 +1918,8 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSessionAggOperator
if
(
gid
!=
pRowSup
->
groupId
||
pInfo
->
winSup
.
prevTs
==
INT64_MIN
)
{
doKeepNewWindowStartInfo
(
pRowSup
,
tsList
,
j
,
gid
);
doKeepTuple
(
pRowSup
,
tsList
[
j
],
gid
);
}
else
if
((
tsList
[
j
]
-
pRowSup
->
prevTs
>=
0
)
&&
tsList
[
j
]
-
pRowSup
->
prevTs
<=
gap
||
(
pRowSup
->
prevTs
-
tsList
[
j
]
>=
0
)
&&
(
pRowSup
->
prevTs
-
tsList
[
j
]
<=
gap
))
{
}
else
if
((
(
tsList
[
j
]
-
pRowSup
->
prevTs
>=
0
)
&&
(
tsList
[
j
]
-
pRowSup
->
prevTs
<=
gap
))
||
(
(
pRowSup
->
prevTs
-
tsList
[
j
]
>=
0
)
&&
(
pRowSup
->
prevTs
-
tsList
[
j
]
<=
gap
)
))
{
// The gap is less than the threshold, so it belongs to current session window that has been opened already.
doKeepTuple
(
pRowSup
,
tsList
[
j
],
gid
);
if
(
j
==
0
&&
pRowSup
->
startRowIndex
!=
0
)
{
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
b250efee
...
...
@@ -44,12 +44,15 @@ static void setColumnInfo(SFunctionNode* pFunc, SColumnNode* pCol) {
pCol
->
colType
=
COLUMN_TYPE_TBNAME
;
break
;
case
FUNCTION_TYPE_WSTART
:
pCol
->
colId
=
PRIMARYKEY_TIMESTAMP_COL_ID
;
pCol
->
colType
=
COLUMN_TYPE_WINDOW_START
;
break
;
case
FUNCTION_TYPE_WEND
:
pCol
->
colId
=
PRIMARYKEY_TIMESTAMP_COL_ID
;
pCol
->
colType
=
COLUMN_TYPE_WINDOW_
PC
;
pCol
->
colType
=
COLUMN_TYPE_WINDOW_
END
;
break
;
case
FUNCTION_TYPE_WDURATION
:
pCol
->
colType
=
COLUMN_TYPE_WINDOW_
PC
;
pCol
->
colType
=
COLUMN_TYPE_WINDOW_
DURATION
;
break
;
case
FUNCTION_TYPE_GROUP_KEY
:
pCol
->
colType
=
COLUMN_TYPE_GROUP_KEY
;
...
...
@@ -784,7 +787,10 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele
static
EDealRes
needFillValueImpl
(
SNode
*
pNode
,
void
*
pContext
)
{
if
(
QUERY_NODE_COLUMN
==
nodeType
(
pNode
))
{
SColumnNode
*
pCol
=
(
SColumnNode
*
)
pNode
;
if
(
COLUMN_TYPE_WINDOW_PC
!=
pCol
->
colType
&&
COLUMN_TYPE_GROUP_KEY
!=
pCol
->
colType
)
{
if
(
COLUMN_TYPE_WINDOW_START
!=
pCol
->
colType
&&
COLUMN_TYPE_WINDOW_END
!=
pCol
->
colType
&&
COLUMN_TYPE_WINDOW_DURATION
!=
pCol
->
colType
&&
COLUMN_TYPE_GROUP_KEY
!=
pCol
->
colType
)
{
*
(
bool
*
)
pContext
=
true
;
return
DEAL_RES_END
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录