Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
460d43f2
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看板
提交
460d43f2
编写于
4月 08, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<fix>: fix index map error from table scan to sort output
上级
65a21314
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
13 deletion
+15
-13
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+7
-5
source/libs/executor/inc/tsort.h
source/libs/executor/inc/tsort.h
+0
-5
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-2
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+7
-1
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
460d43f2
...
...
@@ -315,6 +315,7 @@ int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock) {
return
0
;
}
// if pIndexMap = NULL, merger one column by on column
int32_t
blockDataMerge
(
SSDataBlock
*
pDest
,
const
SSDataBlock
*
pSrc
,
SArray
*
pIndexMap
)
{
assert
(
pSrc
!=
NULL
&&
pDest
!=
NULL
);
...
...
@@ -380,17 +381,18 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
size_t
payloadSize
=
pageSize
-
(
headerSize
+
colHeaderSize
);
// TODO speedup by checking if the whole page can fit in firstly.
/*
if (!hasVarCol) {
if
(
!
hasVarCol
)
{
size_t
rowSize
=
blockDataGetRowSize
(
pBlock
);
int32_t capacity = (payloadSize / (rowSize * 8 + bitmapChar * numOfCols)) * 8; //if pageSize = 128, rowSize = 2, it will core in doAddToBuf:assert(size <= getBufPageSize(pHandle->pBuf));
int32_t
capacity
=
payloadSize
/
(
rowSize
+
numOfCols
*
bitmapChar
/
8
.
0
);
ASSERT
(
capacity
>
0
);
*stopIndex = startIndex + capacity;
*
stopIndex
=
startIndex
+
capacity
-
1
;
if
(
*
stopIndex
>=
numOfRows
)
{
*
stopIndex
=
numOfRows
-
1
;
}
return
TSDB_CODE_SUCCESS
;
}
*/
}
// iterate the rows that can be fit in this buffer page
int32_t
size
=
(
headerSize
+
colHeaderSize
);
...
...
@@ -532,7 +534,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
size_t
metaSize
=
pBlock
->
info
.
rows
*
sizeof
(
int32_t
);
if
(
IS_VAR_DATA_TYPE
(
pCol
->
info
.
type
))
{
char
*
tmp
=
taosMemoryRealloc
(
pCol
->
varmeta
.
offset
,
metaSize
);
char
*
tmp
=
taosMemoryRealloc
(
pCol
->
varmeta
.
offset
,
metaSize
);
// preview calloc is too small
if
(
tmp
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
source/libs/executor/inc/tsort.h
浏览文件 @
460d43f2
...
...
@@ -52,11 +52,6 @@ typedef struct SMsortComparParam {
SArray
*
orderInfo
;
// SArray<SBlockOrderInfo>
}
SMsortComparParam
;
struct
STupleHandle
{
SSDataBlock
*
pBlock
;
int32_t
rowIndex
;
};
typedef
struct
SSortHandle
SSortHandle
;
typedef
struct
STupleHandle
STupleHandle
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
460d43f2
...
...
@@ -4734,8 +4734,7 @@ static void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHan
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnInfoData
*
pColInfoSrc
=
taosArrayGet
(
pTupleHandle
->
pBlock
->
pDataBlock
,
i
);
bool
isNull
=
colDataIsNull
(
pColInfoSrc
,
0
,
pTupleHandle
->
rowIndex
,
NULL
);
bool
isNull
=
tsortIsNullVal
(
pTupleHandle
,
i
);
if
(
isNull
)
{
colDataAppend
(
pColInfo
,
pBlock
->
info
.
rows
,
NULL
,
true
);
}
else
{
...
...
source/libs/executor/src/tsort.c
浏览文件 @
460d43f2
...
...
@@ -24,6 +24,11 @@
#include "tutil.h"
#include "tcompare.h"
struct
STupleHandle
{
SSDataBlock
*
pBlock
;
int32_t
rowIndex
;
};
struct
SSortHandle
{
int32_t
type
;
...
...
@@ -678,7 +683,8 @@ STupleHandle* tsortNextTuple(SSortHandle* pHandle) {
}
bool
tsortIsNullVal
(
STupleHandle
*
pVHandle
,
int32_t
colIndex
)
{
return
false
;
SColumnInfoData
*
pColInfoSrc
=
taosArrayGet
(
pVHandle
->
pBlock
->
pDataBlock
,
colIndex
);
return
colDataIsNull
(
pColInfoSrc
,
0
,
pVHandle
->
rowIndex
,
NULL
);
}
void
*
tsortGetValue
(
STupleHandle
*
pVHandle
,
int32_t
colIndex
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录