Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cefe4be1
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,发现更多精彩内容 >>
提交
cefe4be1
编写于
12月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
26ab0894
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
25 deletion
+48
-25
include/common/tdatablock.h
include/common/tdatablock.h
+1
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+19
-0
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+22
-19
source/util/src/tarray.c
source/util/src/tarray.c
+1
-1
source/util/src/thash.c
source/util/src/thash.c
+2
-2
未找到文件。
include/common/tdatablock.h
浏览文件 @
cefe4be1
...
...
@@ -234,6 +234,7 @@ int32_t blockDataSort_rv(SSDataBlock* pDataBlock, SArray* pOrderInfo, bool nullF
int32_t
colInfoDataEnsureCapacity
(
SColumnInfoData
*
pColumn
,
uint32_t
numOfRows
,
bool
clearPayload
);
int32_t
blockDataEnsureCapacity
(
SSDataBlock
*
pDataBlock
,
uint32_t
numOfRows
);
int32_t
blockDataEnsureCapacityNoClear
(
SSDataBlock
*
pDataBlock
,
uint32_t
numOfRows
);
void
colInfoDataCleanup
(
SColumnInfoData
*
pColumn
,
uint32_t
numOfRows
);
void
blockDataCleanup
(
SSDataBlock
*
pDataBlock
);
...
...
source/common/src/tdatablock.c
浏览文件 @
cefe4be1
...
...
@@ -1239,6 +1239,25 @@ int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) {
return
TSDB_CODE_SUCCESS
;
}
size_t
numOfCols
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
p
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
i
);
code
=
doEnsureCapacity
(
p
,
&
pDataBlock
->
info
,
numOfRows
,
true
);
if
(
code
)
{
return
code
;
}
}
pDataBlock
->
info
.
capacity
=
numOfRows
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
blockDataEnsureCapacityNoClear
(
SSDataBlock
*
pDataBlock
,
uint32_t
numOfRows
)
{
int32_t
code
=
0
;
if
(
numOfRows
==
0
||
numOfRows
<=
pDataBlock
->
info
.
capacity
)
{
return
TSDB_CODE_SUCCESS
;
}
size_t
numOfCols
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
p
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
i
);
...
...
source/dnode/vnode/src/tsdb/tsdbReaderWriter.c
浏览文件 @
cefe4be1
...
...
@@ -40,7 +40,7 @@ static int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsd
}
pFD
->
szPage
=
szPage
;
pFD
->
pgno
=
0
;
pFD
->
pBuf
=
taosMemory
Malloc
(
szPage
);
pFD
->
pBuf
=
taosMemory
Calloc
(
1
,
szPage
);
if
(
pFD
->
pBuf
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
taosCloseFile
(
&
pFD
->
pFD
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
cefe4be1
...
...
@@ -1749,7 +1749,7 @@ int32_t doInitAggInfoSup(SAggSupporter* pAggSup, SqlFunctionCtx* pCtx, int32_t n
pAggSup
->
currentPageId
=
-
1
;
pAggSup
->
resultRowSize
=
getResultRowSize
(
pCtx
,
numOfOutput
);
pAggSup
->
keyBuf
=
taosMemoryCalloc
(
1
,
keyBufSize
+
POINTER_BYTES
+
sizeof
(
int64_t
));
pAggSup
->
pResultRowHashTable
=
tSimpleHashInit
(
10
,
hashFn
);
pAggSup
->
pResultRowHashTable
=
tSimpleHashInit
(
10
0
,
hashFn
);
if
(
pAggSup
->
keyBuf
==
NULL
||
pAggSup
->
pResultRowHashTable
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
cefe4be1
...
...
@@ -886,7 +886,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
pInfo
->
pResBlock
=
createDataBlockFromDescNode
(
pDescNode
);
blockDataEnsureCapacity
(
pInfo
->
pResBlock
,
pOperator
->
resultInfo
.
capacity
);
blockDataEnsureCapacity
NoClear
(
pInfo
->
pResBlock
,
pOperator
->
resultInfo
.
capacity
);
code
=
filterInitFromNode
((
SNode
*
)
pTableScanNode
->
scan
.
node
.
pConditions
,
&
pOperator
->
exprSupp
.
pFilterInfo
,
0
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
cefe4be1
...
...
@@ -1658,24 +1658,6 @@ static bool allInvertible(SqlFunctionCtx* pFCtx, int32_t numOfCols) {
static
bool
timeWindowinterpNeeded
(
SqlFunctionCtx
*
pCtx
,
int32_t
numOfCols
,
SIntervalAggOperatorInfo
*
pInfo
)
{
// the primary timestamp column
bool
needed
=
false
;
pInfo
->
pInterpCols
=
taosArrayInit
(
4
,
sizeof
(
SColumn
));
pInfo
->
pPrevValues
=
taosArrayInit
(
4
,
sizeof
(
SGroupKeys
));
{
// ts column
SColumn
c
=
{
0
};
c
.
colId
=
1
;
c
.
slotId
=
pInfo
->
primaryTsIndex
;
c
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
c
.
bytes
=
sizeof
(
int64_t
);
taosArrayPush
(
pInfo
->
pInterpCols
,
&
c
);
SGroupKeys
key
=
{
0
};
key
.
bytes
=
c
.
bytes
;
key
.
type
=
c
.
type
;
key
.
isNull
=
true
;
// to denote no value is assigned yet
key
.
pData
=
taosMemoryCalloc
(
1
,
c
.
bytes
);
taosArrayPush
(
pInfo
->
pPrevValues
,
&
key
);
}
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SExprInfo
*
pExpr
=
pCtx
[
i
].
pExpr
;
...
...
@@ -1696,6 +1678,27 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt
}
}
if
(
needed
)
{
pInfo
->
pInterpCols
=
taosArrayInit
(
4
,
sizeof
(
SColumn
));
pInfo
->
pPrevValues
=
taosArrayInit
(
4
,
sizeof
(
SGroupKeys
));
{
// ts column
SColumn
c
=
{
0
};
c
.
colId
=
1
;
c
.
slotId
=
pInfo
->
primaryTsIndex
;
c
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
c
.
bytes
=
sizeof
(
int64_t
);
taosArrayPush
(
pInfo
->
pInterpCols
,
&
c
);
SGroupKeys
key
;
key
.
bytes
=
c
.
bytes
;
key
.
type
=
c
.
type
;
key
.
isNull
=
true
;
// to denote no value is assigned yet
key
.
pData
=
taosMemoryCalloc
(
1
,
c
.
bytes
);
taosArrayPush
(
pInfo
->
pPrevValues
,
&
key
);
}
}
return
needed
;
}
...
...
@@ -1737,7 +1740,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPh
size_t
keyBufSize
=
sizeof
(
int64_t
)
+
sizeof
(
int64_t
)
+
POINTER_BYTES
;
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
1024
);
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
blockDataEnsureCapacity
NoClear
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
int32_t
num
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pPhyNode
->
window
.
pFuncs
,
NULL
,
&
num
);
...
...
source/util/src/tarray.c
浏览文件 @
cefe4be1
...
...
@@ -33,7 +33,7 @@ SArray* taosArrayInit(size_t size, size_t elemSize) {
}
pArray
->
size
=
0
;
pArray
->
pData
=
taosMemory
Calloc
(
size
,
elemSize
);
pArray
->
pData
=
taosMemory
Malloc
(
size
*
elemSize
);
if
(
pArray
->
pData
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
taosMemoryFree
(
pArray
);
...
...
source/util/src/thash.c
浏览文件 @
cefe4be1
...
...
@@ -244,7 +244,7 @@ SHashObj *taosHashInit(size_t capacity, _hash_fn_t fn, bool update, SHashLockTyp
capacity
=
4
;
}
SHashObj
*
pHashObj
=
(
SHashObj
*
)
taosMemory
Calloc
(
1
,
sizeof
(
SHashObj
));
SHashObj
*
pHashObj
=
(
SHashObj
*
)
taosMemory
Malloc
(
sizeof
(
SHashObj
));
if
(
pHashObj
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
...
...
@@ -264,7 +264,7 @@ SHashObj *taosHashInit(size_t capacity, _hash_fn_t fn, bool update, SHashLockTyp
ASSERT
((
pHashObj
->
capacity
&
(
pHashObj
->
capacity
-
1
))
==
0
);
pHashObj
->
hashList
=
(
SHashEntry
**
)
taosMemory
Calloc
(
pHashObj
->
capacity
,
sizeof
(
void
*
));
pHashObj
->
hashList
=
(
SHashEntry
**
)
taosMemory
Malloc
(
pHashObj
->
capacity
*
sizeof
(
void
*
));
if
(
pHashObj
->
hashList
==
NULL
)
{
taosMemoryFree
(
pHashObj
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录