Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e0716496
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看板
提交
e0716496
编写于
6月 23, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: update the unit test.
上级
c4b1d43b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
10 deletion
+20
-10
include/common/tcommon.h
include/common/tcommon.h
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+3
-0
source/libs/scalar/test/scalar/scalarTests.cpp
source/libs/scalar/test/scalar/scalarTests.cpp
+16
-9
未找到文件。
include/common/tcommon.h
浏览文件 @
e0716496
...
...
@@ -68,7 +68,7 @@ typedef struct SColumnDataAgg {
typedef
struct
SDataBlockInfo
{
STimeWindow
window
;
int32_t
rows
;
int32_t
rows
;
// todo hide this attribute
int32_t
rowSize
;
uint64_t
uid
;
// the uid of table, from which current data block comes
uint16_t
blockId
;
// block id, generated by physical planner
...
...
source/common/src/tdatablock.c
浏览文件 @
e0716496
...
...
@@ -1109,6 +1109,9 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo *
return
TSDB_CODE_SUCCESS
;
}
// todo temp disable it
// ASSERT(pColumn->info.bytes != 0);
int32_t
existedRows
=
pBlockInfo
->
rows
;
if
(
IS_VAR_DATA_TYPE
(
pColumn
->
info
.
type
))
{
...
...
source/libs/scalar/test/scalar/scalarTests.cpp
浏览文件 @
e0716496
...
...
@@ -86,15 +86,17 @@ void scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *s
if
(
newBlock
)
{
SSDataBlock
*
res
=
createDataBlock
();
SColumnInfoData
idata
=
{
0
};
idata
.
info
=
*
colInfo
;
SColumnInfoData
idata
=
{.
info
=
*
colInfo
};
colInfoDataEnsureCapacity
(
&
idata
,
rows
);
blockDataAppendColInfo
(
res
,
&
idata
);
blockDataEnsureCapacity
(
res
,
rows
)
;
res
->
info
.
capacity
=
rows
;
res
->
info
.
rows
=
rows
;
SColumnInfoData
*
p
=
static_cast
<
SColumnInfoData
*>
(
taosArrayGet
(
res
->
pDataBlock
,
0
));
ASSERT
(
p
->
pData
!=
NULL
&&
p
->
nullbitmap
!=
NULL
);
taosArrayPush
(
pBlockList
,
&
res
);
*
dataBlockId
=
taosArrayGetSize
(
pBlockList
)
-
1
;
res
->
info
.
blockId
=
*
dataBlockId
;
*
slotId
=
0
;
...
...
@@ -102,6 +104,7 @@ void scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *s
SSDataBlock
*
res
=
*
(
SSDataBlock
**
)
taosArrayGetLast
(
pBlockList
);
SColumnInfoData
idata
=
{
0
};
idata
.
info
=
*
colInfo
;
colInfoDataEnsureCapacity
(
&
idata
,
rows
);
blockDataAppendColInfo
(
res
,
&
idata
);
*
dataBlockId
=
taosArrayGetSize
(
pBlockList
)
-
1
;
...
...
@@ -140,17 +143,18 @@ void scltMakeColumnNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
if
(
NULL
==
*
block
)
{
SSDataBlock
*
res
=
createDataBlock
();
res
->
info
.
rows
=
rowNum
;
for
(
int32_t
i
=
0
;
i
<
2
;
++
i
)
{
SColumnInfoData
idata
=
createColumnInfoData
(
TSDB_DATA_TYPE_
NULL
,
10
,
i
+
1
);
int32_t
size
=
idata
.
info
.
bytes
*
rowNum
;
SColumnInfoData
idata
=
createColumnInfoData
(
TSDB_DATA_TYPE_
INT
,
10
,
i
+
1
);
colInfoDataEnsureCapacity
(
&
idata
,
rowNum
)
;
blockDataAppendColInfo
(
res
,
&
idata
);
}
SColumnInfoData
idata
=
createColumnInfoData
(
dataType
,
dataBytes
,
3
);
colInfoDataEnsureCapacity
(
&
idata
,
rowNum
);
blockDataAppendColInfo
(
res
,
&
idata
);
blockDataEnsureCapacity
(
res
,
rowNum
)
;
res
->
info
.
capacity
=
rowNum
;
res
->
info
.
rows
=
rowNum
;
SColumnInfoData
*
pColumn
=
(
SColumnInfoData
*
)
taosArrayGetLast
(
res
->
pDataBlock
);
for
(
int32_t
i
=
0
;
i
<
rowNum
;
++
i
)
{
colDataAppend
(
pColumn
,
i
,
(
const
char
*
)
value
,
false
);
...
...
@@ -170,8 +174,10 @@ void scltMakeColumnNode(SNode **pNode, SSDataBlock **block, int32_t dataType, in
int32_t
idx
=
taosArrayGetSize
(
res
->
pDataBlock
);
SColumnInfoData
idata
=
createColumnInfoData
(
dataType
,
dataBytes
,
1
+
idx
);
colInfoDataEnsureCapacity
(
&
idata
,
rowNum
);
res
->
info
.
capacity
=
rowNum
;
blockDataAppendColInfo
(
res
,
&
idata
);
blockDataEnsureCapacity
(
res
,
rowNum
);
SColumnInfoData
*
pColumn
=
(
SColumnInfoData
*
)
taosArrayGetLast
(
res
->
pDataBlock
);
...
...
@@ -1507,6 +1513,7 @@ TEST(columnTest, bigint_column_multi_binary_column) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_DOUBLE
,
sizeof
(
double
));
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录