Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1ae71a85
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1ae71a85
编写于
12月 23, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix none fill column value issue
上级
9ab98f02
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
22 addition
and
30 deletion
+22
-30
source/libs/executor/src/filloperator.c
source/libs/executor/src/filloperator.c
+1
-0
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+21
-30
未找到文件。
source/libs/executor/src/filloperator.c
浏览文件 @
1ae71a85
...
@@ -170,6 +170,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
...
@@ -170,6 +170,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
// Fill the previous group data block, before handle the data block of new group.
// Fill the previous group data block, before handle the data block of new group.
// Close the fill operation for previous group data block
// Close the fill operation for previous group data block
taosFillSetStartInfo
(
pInfo
->
pFillInfo
,
0
,
pInfo
->
win
.
ekey
);
taosFillSetStartInfo
(
pInfo
->
pFillInfo
,
0
,
pInfo
->
win
.
ekey
);
pInfo
->
pFillInfo
->
prev
.
key
=
0
;
}
}
}
}
...
...
source/libs/executor/src/tfill.c
浏览文件 @
1ae71a85
...
@@ -37,14 +37,7 @@
...
@@ -37,14 +37,7 @@
static
void
doSetVal
(
SColumnInfoData
*
pDstColInfoData
,
int32_t
rowIndex
,
const
SGroupKeys
*
pKey
);
static
void
doSetVal
(
SColumnInfoData
*
pDstColInfoData
,
int32_t
rowIndex
,
const
SGroupKeys
*
pKey
);
static
void
setNullRow
(
SSDataBlock
*
pBlock
,
SFillInfo
*
pFillInfo
,
int32_t
rowIndex
)
{
static
void
setNotFillColumn
(
SFillInfo
*
pFillInfo
,
SColumnInfoData
*
pDstColInfo
,
int32_t
rowIndex
,
int32_t
colIdx
)
{
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
int32_t
dstSlotId
=
GET_DEST_SLOT_ID
(
pCol
);
SColumnInfoData
*
pDstColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
dstSlotId
);
if
(
pCol
->
notFillCol
)
{
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfo
,
rowIndex
);
if
(
!
filled
)
{
SRowVal
*
p
=
NULL
;
SRowVal
*
p
=
NULL
;
if
(
FILL_IS_ASC_FILL
(
pFillInfo
))
{
if
(
FILL_IS_ASC_FILL
(
pFillInfo
))
{
if
(
pFillInfo
->
prev
.
key
!=
0
)
{
if
(
pFillInfo
->
prev
.
key
!=
0
)
{
...
@@ -56,8 +49,19 @@ static void setNullRow(SSDataBlock* pBlock, SFillInfo* pFillInfo, int32_t rowInd
...
@@ -56,8 +49,19 @@ static void setNullRow(SSDataBlock* pBlock, SFillInfo* pFillInfo, int32_t rowInd
p
=
&
pFillInfo
->
next
;
p
=
&
pFillInfo
->
next
;
}
}
SGroupKeys
*
pKey
=
taosArrayGet
(
p
->
pRowVal
,
i
);
SGroupKeys
*
pKey
=
taosArrayGet
(
p
->
pRowVal
,
colIdx
);
doSetVal
(
pDstColInfo
,
rowIndex
,
pKey
);
doSetVal
(
pDstColInfo
,
rowIndex
,
pKey
);
}
static
void
setNullRow
(
SSDataBlock
*
pBlock
,
SFillInfo
*
pFillInfo
,
int32_t
rowIndex
)
{
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
int32_t
dstSlotId
=
GET_DEST_SLOT_ID
(
pCol
);
SColumnInfoData
*
pDstColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
dstSlotId
);
if
(
pCol
->
notFillCol
)
{
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfo
,
rowIndex
);
if
(
!
filled
)
{
setNotFillColumn
(
pFillInfo
,
pDstColInfo
,
rowIndex
,
i
);
}
}
}
else
{
}
else
{
colDataAppendNULL
(
pDstColInfo
,
rowIndex
);
colDataAppendNULL
(
pDstColInfo
,
rowIndex
);
...
@@ -124,28 +128,23 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
...
@@ -124,28 +128,23 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
// set the other values
// set the other values
if
(
pFillInfo
->
type
==
TSDB_FILL_PREV
)
{
if
(
pFillInfo
->
type
==
TSDB_FILL_PREV
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
prev
.
pRowVal
:
pFillInfo
->
next
.
pRowVal
;
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
SColumnInfoData
*
pDstColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GET_DEST_SLOT_ID
(
pCol
));
SColumnInfoData
*
pDstColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GET_DEST_SLOT_ID
(
pCol
));
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfoData
,
index
);
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfoData
,
index
);
if
(
!
filled
)
{
if
(
!
filled
)
{
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
setNotFillColumn
(
pFillInfo
,
pDstColInfoData
,
index
,
i
);
doSetVal
(
pDstColInfoData
,
index
,
pKey
);
}
}
}
}
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
)
{
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
next
.
pRowVal
:
pFillInfo
->
prev
.
pRowVal
;
// todo refactor: start from 0 not 1
// todo refactor: start from 0 not 1
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
SColumnInfoData
*
pDstColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GET_DEST_SLOT_ID
(
pCol
));
SColumnInfoData
*
pDstColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GET_DEST_SLOT_ID
(
pCol
));
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfoData
,
index
);
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstColInfoData
,
index
);
if
(
!
filled
)
{
if
(
!
filled
)
{
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
setNotFillColumn
(
pFillInfo
,
pDstColInfoData
,
index
,
i
);
doSetVal
(
pDstColInfoData
,
index
,
pKey
);
}
}
}
}
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_LINEAR
)
{
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_LINEAR
)
{
...
@@ -163,9 +162,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
...
@@ -163,9 +162,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
if
(
pCol
->
notFillCol
)
{
if
(
pCol
->
notFillCol
)
{
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstCol
,
index
);
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDstCol
,
index
);
if
(
!
filled
)
{
if
(
!
filled
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
prev
.
pRowVal
:
pFillInfo
->
next
.
pRowVal
;
setNotFillColumn
(
pFillInfo
,
pDstCol
,
index
,
i
);
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
doSetVal
(
pDstCol
,
index
,
pKey
);
}
}
}
else
{
}
else
{
SGroupKeys
*
pKey
=
taosArrayGet
(
pFillInfo
->
prev
.
pRowVal
,
i
);
SGroupKeys
*
pKey
=
taosArrayGet
(
pFillInfo
->
prev
.
pRowVal
,
i
);
...
@@ -205,9 +202,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
...
@@ -205,9 +202,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
if
(
pCol
->
notFillCol
)
{
if
(
pCol
->
notFillCol
)
{
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDst
,
index
);
bool
filled
=
fillIfWindowPseudoColumn
(
pFillInfo
,
pCol
,
pDst
,
index
);
if
(
!
filled
)
{
if
(
!
filled
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
prev
.
pRowVal
:
pFillInfo
->
next
.
pRowVal
;
setNotFillColumn
(
pFillInfo
,
pDst
,
index
,
i
);
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
doSetVal
(
pDst
,
index
,
pKey
);
}
}
}
else
{
}
else
{
SVariant
*
pVar
=
&
pFillInfo
->
pFillCol
[
i
].
fillVal
;
SVariant
*
pVar
=
&
pFillInfo
->
pFillCol
[
i
].
fillVal
;
...
@@ -297,10 +292,6 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
...
@@ -297,10 +292,6 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
&
pFillInfo
->
next
);
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
&
pFillInfo
->
next
);
}
}
if
(
pFillInfo
->
currentKey
<
ts
&&
ascFill
&&
0
==
pFillInfo
->
index
)
{
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
&
pFillInfo
->
prev
);
}
if
(((
pFillInfo
->
currentKey
<
ts
&&
ascFill
)
||
(
pFillInfo
->
currentKey
>
ts
&&
!
ascFill
))
&&
if
(((
pFillInfo
->
currentKey
<
ts
&&
ascFill
)
||
(
pFillInfo
->
currentKey
>
ts
&&
!
ascFill
))
&&
pFillInfo
->
numOfCurrent
<
outputRows
)
{
pFillInfo
->
numOfCurrent
<
outputRows
)
{
// fill the gap between two input rows
// fill the gap between two input rows
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录