Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
411086c8
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,发现更多精彩内容 >>
提交
411086c8
编写于
4月 03, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix error in sort operation
上级
5aa3467e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
55 addition
and
43 deletion
+55
-43
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+54
-42
source/libs/executor/test/sortTests.cpp
source/libs/executor/test/sortTests.cpp
+1
-1
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
411086c8
...
@@ -176,6 +176,8 @@ int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t currentRow, con
...
@@ -176,6 +176,8 @@ int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t currentRow, con
static
void
doBitmapMerge
(
SColumnInfoData
*
pColumnInfoData
,
int32_t
numOfRow1
,
const
SColumnInfoData
*
pSource
,
static
void
doBitmapMerge
(
SColumnInfoData
*
pColumnInfoData
,
int32_t
numOfRow1
,
const
SColumnInfoData
*
pSource
,
int32_t
numOfRow2
)
{
int32_t
numOfRow2
)
{
if
(
numOfRow2
<=
0
)
return
;
uint32_t
total
=
numOfRow1
+
numOfRow2
;
uint32_t
total
=
numOfRow1
+
numOfRow2
;
if
(
BitmapLen
(
numOfRow1
)
<
BitmapLen
(
total
))
{
if
(
BitmapLen
(
numOfRow1
)
<
BitmapLen
(
total
))
{
...
@@ -190,22 +192,32 @@ static void doBitmapMerge(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, c
...
@@ -190,22 +192,32 @@ static void doBitmapMerge(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, c
if
(
remindBits
==
0
)
{
// no need to shift bits of bitmap
if
(
remindBits
==
0
)
{
// no need to shift bits of bitmap
memcpy
(
pColumnInfoData
->
nullbitmap
+
BitmapLen
(
numOfRow1
),
pSource
->
nullbitmap
,
BitmapLen
(
numOfRow2
));
memcpy
(
pColumnInfoData
->
nullbitmap
+
BitmapLen
(
numOfRow1
),
pSource
->
nullbitmap
,
BitmapLen
(
numOfRow2
));
}
else
{
return
;
int32_t
len
=
BitmapLen
(
numOfRow2
);
}
int32_t
i
=
0
;
uint8_t
*
p
=
(
uint8_t
*
)
pSource
->
nullbitmap
;
uint8_t
*
p
=
(
uint8_t
*
)
pSource
->
nullbitmap
;
pColumnInfoData
->
nullbitmap
[
BitmapLen
(
numOfRow1
)
-
1
]
|=
(
p
[
0
]
>>
remindBits
);
pColumnInfoData
->
nullbitmap
[
BitmapLen
(
numOfRow1
)
-
1
]
|=
(
p
[
0
]
>>
remindBits
);
// copy remind bits
uint8_t
*
start
=
(
uint8_t
*
)
&
pColumnInfoData
->
nullbitmap
[
BitmapLen
(
numOfRow1
)];
if
(
BitmapLen
(
numOfRow1
)
==
BitmapLen
(
total
))
{
while
(
i
<
len
)
{
return
;
start
[
i
]
|=
(
p
[
i
]
<<
shiftBits
);
}
i
+=
1
;
int32_t
len
=
BitmapLen
(
numOfRow2
);
int32_t
i
=
0
;
if
(
i
>
1
)
{
uint8_t
*
start
=
(
uint8_t
*
)
&
pColumnInfoData
->
nullbitmap
[
BitmapLen
(
numOfRow1
)];
start
[
i
-
1
]
|=
(
p
[
i
]
>>
remindBits
);
int32_t
overCount
=
BitmapLen
(
total
)
-
BitmapLen
(
numOfRow1
);
while
(
i
<
len
)
{
// size limit of pSource->nullbitmap
if
(
i
>=
1
)
{
start
[
i
-
1
]
|=
(
p
[
i
]
>>
remindBits
);
//copy remind bits
}
}
if
(
i
>=
overCount
)
{
// size limit of pColumnInfoData->nullbitmap
return
;
}
}
start
[
i
]
|=
(
p
[
i
]
<<
shiftBits
);
//copy shift bits
i
+=
1
;
}
}
}
}
...
@@ -408,7 +420,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
...
@@ -408,7 +420,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
{
}
// iterate the rows that can be fit in this buffer page
// iterate the rows that can be fit in this buffer page
int32_t
size
=
(
headerSize
+
colHeaderSize
);
int32_t
size
=
(
headerSize
+
colHeaderSize
);
...
@@ -445,7 +457,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
...
@@ -445,7 +457,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
// all fit in
// all fit in
*
stopIndex
=
numOfRows
-
1
;
*
stopIndex
=
numOfRows
-
1
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
}
SSDataBlock
*
blockDataExtractBlock
(
SSDataBlock
*
pBlock
,
int32_t
startIndex
,
int32_t
rowCount
)
{
SSDataBlock
*
blockDataExtractBlock
(
SSDataBlock
*
pBlock
,
int32_t
startIndex
,
int32_t
rowCount
)
{
...
...
source/libs/executor/test/sortTests.cpp
浏览文件 @
411086c8
...
@@ -83,7 +83,7 @@ SSDataBlock* getSingleColStrBlock(void* param) {
...
@@ -83,7 +83,7 @@ SSDataBlock* getSingleColStrBlock(void* param) {
SColumnInfoData
colInfo
=
{
0
};
SColumnInfoData
colInfo
=
{
0
};
colInfo
.
info
.
type
=
TSDB_DATA_TYPE_NCHAR
;
colInfo
.
info
.
type
=
TSDB_DATA_TYPE_NCHAR
;
colInfo
.
info
.
bytes
=
TSDB_NCHAR_SIZE
*
16
;
colInfo
.
info
.
bytes
=
TSDB_NCHAR_SIZE
*
16
+
VARSTR_HEADER_SIZE
;
colInfo
.
info
.
colId
=
1
;
colInfo
.
info
.
colId
=
1
;
colInfo
.
varmeta
.
offset
=
static_cast
<
int32_t
*>
(
taosMemoryCalloc
(
pInfo
->
pageRows
,
sizeof
(
int32_t
)));
colInfo
.
varmeta
.
offset
=
static_cast
<
int32_t
*>
(
taosMemoryCalloc
(
pInfo
->
pageRows
,
sizeof
(
int32_t
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录