Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
24614d03
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看板
提交
24614d03
编写于
12月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): set correct sma retrieve procedure.
上级
efcc3b06
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
19 deletion
+25
-19
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+23
-19
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-0
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
24614d03
...
@@ -84,7 +84,7 @@ typedef struct SIOCostSummary {
...
@@ -84,7 +84,7 @@ typedef struct SIOCostSummary {
typedef
struct
SBlockLoadSuppInfo
{
typedef
struct
SBlockLoadSuppInfo
{
SArray
*
pColAgg
;
SArray
*
pColAgg
;
SColumnDataAgg
tsColAgg
;
SColumnDataAgg
tsColAgg
;
SColumnDataAgg
**
plist
;
SColumnDataAgg
**
plist
;
// todo remove this
int16_t
*
colIds
;
// column ids for loading file block data
int16_t
*
colIds
;
// column ids for loading file block data
int16_t
*
slotIds
;
// the ordinal index in the destination SSDataBlock
int16_t
*
slotIds
;
// the ordinal index in the destination SSDataBlock
int32_t
numOfCols
;
int32_t
numOfCols
;
...
@@ -4041,12 +4041,11 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
...
@@ -4041,12 +4041,11 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
}
}
SFileDataBlockInfo
*
pFBlock
=
getCurrentBlockInfo
(
&
pReader
->
status
.
blockIter
);
SFileDataBlockInfo
*
pFBlock
=
getCurrentBlockInfo
(
&
pReader
->
status
.
blockIter
);
SDataBlk
*
pBlock
=
getCurrentBlock
(
&
pReader
->
status
.
blockIter
);
// int64_t stime = taosGetTimestampUs();
SBlockLoadSuppInfo
*
pSup
=
&
pReader
->
suppInfo
;
SBlockLoadSuppInfo
*
pSup
=
&
pReader
->
suppInfo
;
ASSERT
(
pReader
->
pResBlock
->
info
.
id
.
uid
==
pFBlock
->
uid
);
SDataBlk
*
pBlock
=
getCurrentBlock
(
&
pReader
->
status
.
blockIter
);
if
(
tDataBlkHasSma
(
pBlock
))
{
if
(
tDataBlkHasSma
(
pBlock
))
{
code
=
tsdbReadBlockSma
(
pReader
->
pFileReader
,
pBlock
,
pSup
->
pColAgg
);
code
=
tsdbReadBlockSma
(
pReader
->
pFileReader
,
pBlock
,
pSup
->
pColAgg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -4071,7 +4070,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
...
@@ -4071,7 +4070,7 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
pSup
->
plist
[
0
]
=
pTsAgg
;
pSup
->
plist
[
0
]
=
pTsAgg
;
// update the number of NULL data rows
// update the number of NULL data rows
size_t
numOfCols
=
blockDataGetNumOfCols
(
pReader
->
pResBlock
)
;
size_t
numOfCols
=
pSup
->
numOfCols
;
int32_t
i
=
0
,
j
=
0
;
int32_t
i
=
0
,
j
=
0
;
size_t
size
=
taosArrayGetSize
(
pSup
->
pColAgg
);
size_t
size
=
taosArrayGetSize
(
pSup
->
pColAgg
);
...
@@ -4095,43 +4094,48 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
...
@@ -4095,43 +4094,48 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
}
}
#else
#else
SSDataBlock
*
pResBlock
=
pReader
->
pResBlock
;
if
(
pResBlock
->
pBlockAgg
==
NULL
)
{
size_t
num
=
taosArrayGetSize
(
pResBlock
->
pDataBlock
);
pResBlock
->
pBlockAgg
=
taosMemoryCalloc
(
num
,
sizeof
(
SColumnDataAgg
));
}
// fill the all null data column
// fill the all null data column
SArray
*
pNewAggList
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColumnDataAgg
));
//
SArray* pNewAggList = taosArrayInit(numOfCols, sizeof(SColumnDataAgg));
while
(
j
<
numOfCols
&&
i
<
size
)
{
while
(
j
<
numOfCols
&&
i
<
size
)
{
SColumnDataAgg
*
pAgg
=
taosArrayGet
(
pSup
->
pColAgg
,
i
);
SColumnDataAgg
*
pAgg
=
taosArrayGet
(
pSup
->
pColAgg
,
i
);
if
(
pAgg
->
colId
==
pSup
->
colIds
[
j
])
{
if
(
pAgg
->
colId
==
pSup
->
colIds
[
j
])
{
taosArrayPush
(
pNewAggList
,
pAgg
)
;
pResBlock
->
pBlockAgg
[
pSup
->
slotIds
[
j
]]
=
pAgg
;
i
+=
1
;
i
+=
1
;
j
+=
1
;
j
+=
1
;
}
else
if
(
pAgg
->
colId
<
pSup
->
colIds
[
j
])
{
}
else
if
(
pAgg
->
colId
<
pSup
->
colIds
[
j
])
{
i
+=
1
;
i
+=
1
;
}
else
if
(
pSup
->
colIds
[
j
]
<
pAgg
->
colId
)
{
}
else
if
(
pSup
->
colIds
[
j
]
<
pAgg
->
colId
)
{
if
(
pSup
->
colIds
[
j
]
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
if
(
pSup
->
colIds
[
j
]
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
taosArrayPush
(
pNewAggList
,
&
pSup
->
tsColAgg
)
;
pResBlock
->
pBlockAgg
[
pSup
->
slotIds
[
j
]]
=
&
pSup
->
tsColAgg
;
}
else
{
}
else
{
// all date in this block are null
// all date in this block are null
SColumnDataAgg
nullColAgg
=
{.
colId
=
pSup
->
colIds
[
j
],
.
numOfNull
=
pBlock
->
nRow
};
SColumnDataAgg
nullColAgg
=
{.
colId
=
pSup
->
colIds
[
j
],
.
numOfNull
=
pBlock
->
nRow
};
taosArrayPush
(
pNewAggList
,
&
nullColAgg
);
taosArrayPush
(
pSup
->
pColAgg
,
&
nullColAgg
);
pResBlock
->
pBlockAgg
[
pSup
->
slotIds
[
j
]]
=
taosArrayGetLast
(
pSup
->
pColAgg
);
}
}
j
+=
1
;
j
+=
1
;
}
}
}
}
taosArrayClear
(
pSup
->
pColAgg
);
// taosArrayClear(pSup->pColAgg);
taosArrayAddAll
(
pSup
->
pColAgg
,
pNewAggList
);
size_t
num
=
taosArrayGetSize
(
pSup
->
pColAgg
);
for
(
int32_t
k
=
0
;
k
<
num
;
++
k
)
{
pSup
->
plist
[
k
]
=
taosArrayGet
(
pSup
->
pColAgg
,
k
);
}
taosArrayDestroy
(
pNewAggList
);
// size_t num = taosArrayGetSize(pSup->pColAgg);
// for(int32_t k = 0; k < num; ++k) {
// pSup->plist[k] = taosArrayGet(pSup->pColAgg, k);
// }
#endif
#endif
pReader
->
cost
.
smaDataLoad
+=
1
;
pReader
->
cost
.
smaDataLoad
+=
1
;
*
pBlockStatis
=
pSup
->
plist
;
//
*pBlockStatis = pSup->plist;
tsdbDebug
(
"vgId:%d, succeed to load block SMA for uid %"
PRIu64
", %s"
,
0
,
pFBlock
->
uid
,
pReader
->
idStr
);
tsdbDebug
(
"vgId:%d, succeed to load block SMA for uid %"
PRIu64
", %s"
,
0
,
pFBlock
->
uid
,
pReader
->
idStr
);
return
code
;
return
code
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
24614d03
...
@@ -236,6 +236,7 @@ static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock,
...
@@ -236,6 +236,7 @@ static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock,
return
false
;
return
false
;
}
}
#if 0
// if (allColumnsHaveAgg == true) {
// if (allColumnsHaveAgg == true) {
int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
...
@@ -256,6 +257,7 @@ static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock,
...
@@ -256,6 +257,7 @@ static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock,
pBlock->pBlockAgg[pColMatchInfo->dstSlotId] = pColAgg[i];
pBlock->pBlockAgg[pColMatchInfo->dstSlotId] = pColAgg[i];
}
}
#endif
return
true
;
return
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录