Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d388a8b7
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d388a8b7
编写于
4月 28, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-166
上级
a732f771
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
12 addition
and
19 deletion
+12
-19
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+1
-2
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+4
-8
src/query/tests/astTest.cpp
src/query/tests/astTest.cpp
+2
-2
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+1
-3
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+2
-2
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+1
-1
src/tsdb/tests/tsdbTests.cpp
src/tsdb/tests/tsdbTests.cpp
+1
-1
未找到文件。
src/common/inc/tdataformat.h
浏览文件 @
d388a8b7
...
@@ -161,7 +161,6 @@ typedef struct {
...
@@ -161,7 +161,6 @@ typedef struct {
int
maxRowSize
;
int
maxRowSize
;
int
maxCols
;
// max number of columns
int
maxCols
;
// max number of columns
int
maxPoints
;
// max number of points
int
maxPoints
;
// max number of points
int
exColBytes
;
// extra column bytes to allocate for each column
int
numOfPoints
;
int
numOfPoints
;
int
numOfCols
;
// Total number of cols
int
numOfCols
;
// Total number of cols
...
@@ -175,7 +174,7 @@ typedef struct {
...
@@ -175,7 +174,7 @@ typedef struct {
#define dataColsKeyFirst(pCols) dataColsKeyAt(pCols, 0)
#define dataColsKeyFirst(pCols) dataColsKeyAt(pCols, 0)
#define dataColsKeyLast(pCols) dataColsKeyAt(pCols, (pCols)->numOfPoints - 1)
#define dataColsKeyLast(pCols) dataColsKeyAt(pCols, (pCols)->numOfPoints - 1)
SDataCols
*
tdNewDataCols
(
int
maxRowSize
,
int
maxCols
,
int
maxRows
,
int
exColBytes
);
SDataCols
*
tdNewDataCols
(
int
maxRowSize
,
int
maxCols
,
int
maxRows
);
void
tdResetDataCols
(
SDataCols
*
pCols
);
void
tdResetDataCols
(
SDataCols
*
pCols
);
void
tdInitDataCols
(
SDataCols
*
pCols
,
STSchema
*
pSchema
);
void
tdInitDataCols
(
SDataCols
*
pCols
,
STSchema
*
pSchema
);
SDataCols
*
tdDupDataCols
(
SDataCols
*
pCols
,
bool
keepData
);
SDataCols
*
tdDupDataCols
(
SDataCols
*
pCols
,
bool
keepData
);
...
...
src/common/src/tdataformat.c
浏览文件 @
d388a8b7
...
@@ -287,16 +287,15 @@ void dataColSetOffset(SDataCol *pCol, int nEle, int maxPoints) {
...
@@ -287,16 +287,15 @@ void dataColSetOffset(SDataCol *pCol, int nEle, int maxPoints) {
}
}
}
}
SDataCols
*
tdNewDataCols
(
int
maxRowSize
,
int
maxCols
,
int
maxRows
,
int
exColBytes
)
{
SDataCols
*
tdNewDataCols
(
int
maxRowSize
,
int
maxCols
,
int
maxRows
)
{
SDataCols
*
pCols
=
(
SDataCols
*
)
calloc
(
1
,
sizeof
(
SDataCols
)
+
sizeof
(
SDataCol
)
*
maxCols
);
SDataCols
*
pCols
=
(
SDataCols
*
)
calloc
(
1
,
sizeof
(
SDataCols
)
+
sizeof
(
SDataCol
)
*
maxCols
);
if
(
pCols
==
NULL
)
return
NULL
;
if
(
pCols
==
NULL
)
return
NULL
;
pCols
->
maxRowSize
=
maxRowSize
;
pCols
->
maxRowSize
=
maxRowSize
;
pCols
->
maxCols
=
maxCols
;
pCols
->
maxCols
=
maxCols
;
pCols
->
maxPoints
=
maxRows
;
pCols
->
maxPoints
=
maxRows
;
pCols
->
exColBytes
=
exColBytes
;
pCols
->
buf
=
malloc
(
maxRowSize
*
maxRows
+
exColBytes
*
maxCols
);
pCols
->
buf
=
malloc
(
maxRowSize
*
maxRows
);
if
(
pCols
->
buf
==
NULL
)
{
if
(
pCols
->
buf
==
NULL
)
{
free
(
pCols
);
free
(
pCols
);
return
NULL
;
return
NULL
;
...
@@ -312,16 +311,13 @@ void tdInitDataCols(SDataCols *pCols, STSchema *pSchema) {
...
@@ -312,16 +311,13 @@ void tdInitDataCols(SDataCols *pCols, STSchema *pSchema) {
void
*
ptr
=
pCols
->
buf
;
void
*
ptr
=
pCols
->
buf
;
for
(
int
i
=
0
;
i
<
schemaNCols
(
pSchema
);
i
++
)
{
for
(
int
i
=
0
;
i
<
schemaNCols
(
pSchema
);
i
++
)
{
if
(
i
>
0
)
{
pCols
->
cols
[
i
].
pData
=
(
char
*
)(
pCols
->
cols
[
i
-
1
].
pData
)
+
schemaColAt
(
pSchema
,
i
-
1
)
->
bytes
*
pCols
->
maxPoints
;
}
pCols
->
cols
[
i
].
type
=
colType
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
type
=
colType
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
bytes
=
colBytes
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
bytes
=
colBytes
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
offset
=
colOffset
(
schemaColAt
(
pSchema
,
i
))
+
TD_DATA_ROW_HEAD_SIZE
;
pCols
->
cols
[
i
].
offset
=
colOffset
(
schemaColAt
(
pSchema
,
i
))
+
TD_DATA_ROW_HEAD_SIZE
;
pCols
->
cols
[
i
].
colId
=
colColId
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
colId
=
colColId
(
schemaColAt
(
pSchema
,
i
));
pCols
->
cols
[
i
].
pData
=
ptr
;
pCols
->
cols
[
i
].
pData
=
ptr
;
ptr
=
ptr
+
pCols
->
exColBytes
+
colBytes
(
schemaColAt
(
pSchema
,
i
))
*
pCols
->
maxPoints
;
ptr
=
ptr
+
colBytes
(
schemaColAt
(
pSchema
,
i
))
*
pCols
->
maxPoints
;
if
(
colType
(
schemaColAt
(
pSchema
,
i
))
==
TSDB_DATA_TYPE_BINARY
||
if
(
colType
(
schemaColAt
(
pSchema
,
i
))
==
TSDB_DATA_TYPE_BINARY
||
colType
(
schemaColAt
(
pSchema
,
i
))
==
TSDB_DATA_TYPE_NCHAR
)
colType
(
schemaColAt
(
pSchema
,
i
))
==
TSDB_DATA_TYPE_NCHAR
)
ptr
=
ptr
+
(
sizeof
(
int32_t
)
+
sizeof
(
int16_t
))
*
pCols
->
maxPoints
;
ptr
=
ptr
+
(
sizeof
(
int32_t
)
+
sizeof
(
int16_t
))
*
pCols
->
maxPoints
;
...
@@ -337,7 +333,7 @@ void tdFreeDataCols(SDataCols *pCols) {
...
@@ -337,7 +333,7 @@ void tdFreeDataCols(SDataCols *pCols) {
SDataCols
*
tdDupDataCols
(
SDataCols
*
pDataCols
,
bool
keepData
)
{
SDataCols
*
tdDupDataCols
(
SDataCols
*
pDataCols
,
bool
keepData
)
{
SDataCols
*
pRet
=
SDataCols
*
pRet
=
tdNewDataCols
(
pDataCols
->
maxRowSize
,
pDataCols
->
maxCols
,
pDataCols
->
maxPoints
,
pDataCols
->
exColBytes
);
tdNewDataCols
(
pDataCols
->
maxRowSize
,
pDataCols
->
maxCols
,
pDataCols
->
maxPoints
);
if
(
pRet
==
NULL
)
return
NULL
;
if
(
pRet
==
NULL
)
return
NULL
;
pRet
->
numOfCols
=
pDataCols
->
numOfCols
;
pRet
->
numOfCols
=
pDataCols
->
numOfCols
;
...
...
src/query/tests/astTest.cpp
浏览文件 @
d388a8b7
...
@@ -582,7 +582,7 @@ void exprSerializeTest1() {
...
@@ -582,7 +582,7 @@ void exprSerializeTest1() {
tExprTreeDestroy
(
&
p1
,
nullptr
);
tExprTreeDestroy
(
&
p1
,
nullptr
);
tExprTreeDestroy
(
&
p2
,
nullptr
);
tExprTreeDestroy
(
&
p2
,
nullptr
);
tbufClose
(
&
bw
);
//
tbufClose(&bw);
}
}
void
exprSerializeTest2
()
{
void
exprSerializeTest2
()
{
...
@@ -627,7 +627,7 @@ void exprSerializeTest2() {
...
@@ -627,7 +627,7 @@ void exprSerializeTest2() {
tExprTreeDestroy
(
&
p1
,
nullptr
);
tExprTreeDestroy
(
&
p1
,
nullptr
);
tExprTreeDestroy
(
&
p2
,
nullptr
);
tExprTreeDestroy
(
&
p2
,
nullptr
);
tbufClose
(
&
bw
);
//
tbufClose(&bw);
}
}
}
// namespace
}
// namespace
TEST
(
testCase
,
astTest
)
{
TEST
(
testCase
,
astTest
)
{
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
d388a8b7
...
@@ -879,9 +879,7 @@ static void *tsdbCommitData(void *arg) {
...
@@ -879,9 +879,7 @@ static void *tsdbCommitData(void *arg) {
}
}
if
(
tsdbInitWriteHelper
(
&
whelper
,
pRepo
)
<
0
)
goto
_exit
;
if
(
tsdbInitWriteHelper
(
&
whelper
,
pRepo
)
<
0
)
goto
_exit
;
if
((
pDataCols
=
tdNewDataCols
(
pMeta
->
maxRowBytes
,
pMeta
->
maxCols
,
pCfg
->
maxRowsPerFileBlock
,
if
((
pDataCols
=
tdNewDataCols
(
pMeta
->
maxRowBytes
,
pMeta
->
maxCols
,
pCfg
->
maxRowsPerFileBlock
))
==
NULL
)
goto
_exit
;
sizeof
(
TSCKSUM
)
+
COMP_OVERFLOW_BYTES
))
==
NULL
)
goto
_exit
;
int
sfid
=
tsdbGetKeyFileId
(
pCache
->
imem
->
keyFirst
,
pCfg
->
daysPerFile
,
pCfg
->
precision
);
int
sfid
=
tsdbGetKeyFileId
(
pCache
->
imem
->
keyFirst
,
pCfg
->
daysPerFile
,
pCfg
->
precision
);
int
efid
=
tsdbGetKeyFileId
(
pCache
->
imem
->
keyLast
,
pCfg
->
daysPerFile
,
pCfg
->
precision
);
int
efid
=
tsdbGetKeyFileId
(
pCache
->
imem
->
keyLast
,
pCfg
->
daysPerFile
,
pCfg
->
precision
);
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
d388a8b7
...
@@ -90,8 +90,8 @@ static void tsdbResetHelperBlock(SRWHelper *pHelper) {
...
@@ -90,8 +90,8 @@ static void tsdbResetHelperBlock(SRWHelper *pHelper) {
}
}
static
int
tsdbInitHelperBlock
(
SRWHelper
*
pHelper
)
{
static
int
tsdbInitHelperBlock
(
SRWHelper
*
pHelper
)
{
pHelper
->
pDataCols
[
0
]
=
tdNewDataCols
(
pHelper
->
config
.
maxRowSize
,
pHelper
->
config
.
maxCols
,
pHelper
->
config
.
maxRows
,
sizeof
(
TSCKSUM
)
+
COMP_OVERFLOW_BYTES
);
pHelper
->
pDataCols
[
0
]
=
tdNewDataCols
(
pHelper
->
config
.
maxRowSize
,
pHelper
->
config
.
maxCols
,
pHelper
->
config
.
maxRows
);
pHelper
->
pDataCols
[
1
]
=
tdNewDataCols
(
pHelper
->
config
.
maxRowSize
,
pHelper
->
config
.
maxCols
,
pHelper
->
config
.
maxRows
,
sizeof
(
TSCKSUM
)
+
COMP_OVERFLOW_BYTES
);
pHelper
->
pDataCols
[
1
]
=
tdNewDataCols
(
pHelper
->
config
.
maxRowSize
,
pHelper
->
config
.
maxCols
,
pHelper
->
config
.
maxRows
);
if
(
pHelper
->
pDataCols
[
0
]
==
NULL
||
pHelper
->
pDataCols
[
1
]
==
NULL
)
return
-
1
;
if
(
pHelper
->
pDataCols
[
0
]
==
NULL
||
pHelper
->
pDataCols
[
1
]
==
NULL
)
return
-
1
;
tsdbResetHelperBlockImpl
(
pHelper
);
tsdbResetHelperBlockImpl
(
pHelper
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
d388a8b7
...
@@ -407,7 +407,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
...
@@ -407,7 +407,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
SArray
*
sa
=
getDefaultLoadColumns
(
pQueryHandle
,
true
);
SArray
*
sa
=
getDefaultLoadColumns
(
pQueryHandle
,
true
);
if
(
pCheckInfo
->
pDataCols
==
NULL
)
{
if
(
pCheckInfo
->
pDataCols
==
NULL
)
{
pCheckInfo
->
pDataCols
=
tdNewDataCols
(
1000
,
2
,
4096
,
0
);
pCheckInfo
->
pDataCols
=
tdNewDataCols
(
1000
,
2
,
4096
);
}
}
tdInitDataCols
(
pCheckInfo
->
pDataCols
,
tsdbGetTableSchema
(
tsdbGetMeta
(
pQueryHandle
->
pTsdb
),
pCheckInfo
->
pTableObj
));
tdInitDataCols
(
pCheckInfo
->
pDataCols
,
tsdbGetTableSchema
(
tsdbGetMeta
(
pQueryHandle
->
pTsdb
),
pCheckInfo
->
pTableObj
));
...
...
src/tsdb/tests/tsdbTests.cpp
浏览文件 @
d388a8b7
...
@@ -245,7 +245,7 @@ TEST(TsdbTest, DISABLED_openRepo) {
...
@@ -245,7 +245,7 @@ TEST(TsdbTest, DISABLED_openRepo) {
// tsdbLoadCompCols(&pGroup->files[TSDB_FILE_TYPE_DATA], pBlock, (void *)pCompData);
// tsdbLoadCompCols(&pGroup->files[TSDB_FILE_TYPE_DATA], pBlock, (void *)pCompData);
// STable *pTable = tsdbGetTableByUid(pRepo->tsdbMeta, pCompData->uid);
// STable *pTable = tsdbGetTableByUid(pRepo->tsdbMeta, pCompData->uid);
// SDataCols *pDataCols = tdNewDataCols(tdMaxRowBytesFromSchema(tsdbGetTableSchema(pRepo->tsdbMeta, pTable)), 5
, 10
);
// SDataCols *pDataCols = tdNewDataCols(tdMaxRowBytesFromSchema(tsdbGetTableSchema(pRepo->tsdbMeta, pTable)), 5);
// tdInitDataCols(pDataCols, tsdbGetTableSchema(pRepo->tsdbMeta, pTable));
// tdInitDataCols(pDataCols, tsdbGetTableSchema(pRepo->tsdbMeta, pTable));
// tsdbLoadDataBlock(&pGroup->files[TSDB_FILE_TYPE_DATA], pBlock, 1, pDataCols, pCompData);
// tsdbLoadDataBlock(&pGroup->files[TSDB_FILE_TYPE_DATA], pBlock, 1, pDataCols, pCompData);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录