Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b421a5ec
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看板
提交
b421a5ec
编写于
3月 06, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
差异文件
TD-13852 create stable and create subtable
上级
14e5d6aa
b0a4cc81
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
729 addition
and
555 deletion
+729
-555
include/common/tmsg.h
include/common/tmsg.h
+5
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+26
-11
source/libs/executor/test/executorTests.cpp
source/libs/executor/test/executorTests.cpp
+657
-527
source/libs/parser/test/mockCatalog.cpp
source/libs/parser/test/mockCatalog.cpp
+2
-3
source/libs/parser/test/mockCatalogService.cpp
source/libs/parser/test/mockCatalogService.cpp
+17
-0
source/libs/parser/test/mockCatalogService.h
source/libs/parser/test/mockCatalogService.h
+1
-0
source/libs/scalar/test/scalar/scalarTests.cpp
source/libs/scalar/test/scalar/scalarTests.cpp
+21
-13
未找到文件。
include/common/tmsg.h
浏览文件 @
b421a5ec
...
...
@@ -416,7 +416,11 @@ typedef struct {
* But for data in vnode side, we need all the following information.
*/
typedef
struct
{
int16_t
colId
;
union
{
int16_t
colId
;
int16_t
slotId
;
};
int16_t
type
;
int16_t
bytes
;
SColumnFilterList
flist
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
b421a5ec
...
...
@@ -315,8 +315,6 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO
}
SSDataBlock
*
createOutputBuf_rv
(
SArray
*
pExprInfo
,
int32_t
numOfRows
)
{
const
static
int32_t
minSize
=
8
;
size_t
numOfOutput
=
taosArrayGetSize
(
pExprInfo
);
SSDataBlock
*
res
=
calloc
(
1
,
sizeof
(
SSDataBlock
));
...
...
@@ -330,15 +328,28 @@ SSDataBlock* createOutputBuf_rv(SArray* pExprInfo, int32_t numOfRows) {
idata
.
info
.
type
=
pExpr
->
base
.
resSchema
.
type
;
idata
.
info
.
bytes
=
pExpr
->
base
.
resSchema
.
bytes
;
idata
.
info
.
colId
=
pExpr
->
base
.
resSchema
.
colId
;
int32_t
size
=
TMAX
(
idata
.
info
.
bytes
*
numOfRows
,
minSize
);
idata
.
pData
=
calloc
(
1
,
size
);
// at least to hold a pointer on x64 platform
taosArrayPush
(
res
->
pDataBlock
,
&
idata
);
}
blockDataEnsureCapacity
(
res
,
numOfRows
);
return
res
;
}
SSDataBlock
*
createOutputBuf_rv1
(
SDataBlockDescNode
*
pNode
)
{
int32_t
numOfCols
=
LIST_LENGTH
(
pNode
->
pSlots
);
SSDataBlock
*
pBlock
=
calloc
(
1
,
sizeof
(
SSDataBlock
));
pBlock
->
info
.
numOfCols
=
numOfCols
;
pBlock
->
pDataBlock
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColumnInfoData
));
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
idata
=
{{
0
}};
SSlotDescNode
*
pDescNode
=
nodesListGetNode
(
pNode
->
pSlots
,
i
);
idata
.
info
.
type
=
pDescNode
->
dataType
.
type
;
idata
.
info
.
bytes
=
pDescNode
->
dataType
.
bytes
;
idata
.
info
.
slotId
=
pDescNode
->
slotId
;
}
}
static
bool
isSelectivityWithTagsQuery
(
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
return
true
;
// bool hasTags = false;
...
...
@@ -8041,6 +8052,10 @@ static tsdbReaderT doCreateDataReader(STableScanPhysiNode* pTableScanNode, SRead
static
int32_t
doCreateTableGroup
(
void
*
metaHandle
,
int32_t
tableType
,
uint64_t
tableUid
,
STableGroupInfo
*
pGroupInfo
,
uint64_t
queryId
,
uint64_t
taskId
);
SOperatorInfo
*
doCreateOperatorTreeNode
(
SPhysiNode
*
pPhyNode
,
SExecTaskInfo
*
pTaskInfo
,
SReadHandle
*
pHandle
,
uint64_t
queryId
,
uint64_t
taskId
,
STableGroupInfo
*
pTableGroupInfo
)
{
if
(
nodeType
(
pPhyNode
)
==
QUERY_NODE_PHYSICAL_PLAN_PROJECT
)
{
// ignore the project node
pPhyNode
=
nodesListGetNode
(
pPhyNode
->
pChildren
,
0
);
}
if
(
pPhyNode
->
pChildren
==
NULL
||
LIST_LENGTH
(
pPhyNode
->
pChildren
)
==
0
)
{
if
(
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
==
nodeType
(
pPhyNode
))
{
SScanPhysiNode
*
pScanPhyNode
=
(
SScanPhysiNode
*
)
pPhyNode
;
...
...
@@ -8119,15 +8134,15 @@ static tsdbReaderT createDataReaderImpl(STableScanPhysiNode* pTableScanNode, STa
cond
.
twindow
=
pTableScanNode
->
scanRange
;
cond
.
type
=
BLOCK_LOAD_OFFSET_SEQ_ORDER
;
// cond.type = pTableScanNode->scanFlag;
for
(
int32_t
i
=
0
;
i
<
cond
.
numOfCols
;
++
i
)
{
// SExprInfo* pExprInfo = taosArrayGetP(pTableScanNode->scan.node.pTargets, i);
// assert(pExprInfo->pExpr->nodeType == TEXPR_COL_NODE);
STargetNode
*
pNode
=
(
STargetNode
*
)
nodesListGetNode
(
pTableScanNode
->
scan
.
pScanCols
,
i
);
// SSchema* pSchema = pExprInfo->pExpr->pSchema
;
// cond.colList[i].type = pSchema->t
ype;
// cond.colList[i].bytes = pSchema->bytes
;
// cond.colList[i].colId = pSchema
->colId;
SColumnNode
*
pColNode
=
(
SColumnNode
*
)
pNode
->
pExpr
;
cond
.
colList
[
i
].
type
=
pColNode
->
colT
ype
;
cond
.
colList
[
i
].
bytes
=
pColNode
->
node
.
resType
.
type
;
cond
.
colList
[
i
].
colId
=
pColNode
->
colId
;
}
return
tsdbQueryTables
(
readHandle
,
&
cond
,
pGroupInfo
,
queryId
,
taskId
);
...
...
source/libs/executor/test/executorTests.cpp
浏览文件 @
b421a5ec
此差异已折叠。
点击以展开。
source/libs/parser/test/mockCatalog.cpp
浏览文件 @
b421a5ec
...
...
@@ -58,9 +58,8 @@ int32_t __catalogGetTableHashVgroup(struct SCatalog* pCatalog, void *pRpc, const
return
mockCatalogService
->
catalogGetTableHashVgroup
(
pTableName
,
vgInfo
);
}
int32_t
__catalogGetTableDistVgInfo
(
SCatalog
*
pCatalog
,
void
*
pTransporter
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgroupList
)
{
// return mockCatalogService->catalogGetTableDistVgInfo(pTableName, pVgroupList);
return
0
;
int32_t
__catalogGetTableDistVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgList
)
{
return
mockCatalogService
->
catalogGetTableDistVgInfo
(
pTableName
,
pVgList
);
}
void
initMetaDataEnv
()
{
...
...
source/libs/parser/test/mockCatalogService.cpp
浏览文件 @
b421a5ec
...
...
@@ -126,6 +126,19 @@ public:
return
0
;
}
int32_t
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
{
SVgroupInfo
info
=
{
0
};
info
.
vgId
=
1
;
addEpIntoEpSet
(
&
info
.
epset
,
"node1"
,
6030
);
info
.
hashBegin
=
0
;
info
.
hashEnd
=
1
;
*
pVgList
=
taosArrayInit
(
4
,
sizeof
(
SVgroupInfo
));
taosArrayPush
(
*
pVgList
,
&
info
);
return
0
;
}
TableBuilder
&
createTableBuilder
(
const
std
::
string
&
db
,
const
std
::
string
&
tbname
,
int8_t
tableType
,
int32_t
numOfColumns
,
int32_t
numOfTags
)
{
builder_
=
TableBuilder
::
createTableBuilder
(
tableType
,
numOfColumns
,
numOfTags
);
meta_
[
db
][
tbname
]
=
builder_
->
table
();
...
...
@@ -313,4 +326,8 @@ int32_t MockCatalogService::catalogGetTableMeta(const SName* pTableName, STableM
int32_t
MockCatalogService
::
catalogGetTableHashVgroup
(
const
SName
*
pTableName
,
SVgroupInfo
*
vgInfo
)
const
{
return
impl_
->
catalogGetTableHashVgroup
(
pTableName
,
vgInfo
);
}
int32_t
MockCatalogService
::
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
{
return
impl_
->
catalogGetTableDistVgInfo
(
pTableName
,
pVgList
);
}
\ No newline at end of file
source/libs/parser/test/mockCatalogService.h
浏览文件 @
b421a5ec
...
...
@@ -59,6 +59,7 @@ public:
int32_t
catalogGetTableMeta
(
const
SName
*
pTableName
,
STableMeta
**
pTableMeta
)
const
;
int32_t
catalogGetTableHashVgroup
(
const
SName
*
pTableName
,
SVgroupInfo
*
vgInfo
)
const
;
int32_t
catalogGetTableDistVgInfo
(
const
SName
*
pTableName
,
SArray
**
pVgList
)
const
;
private:
std
::
unique_ptr
<
MockCatalogServiceImpl
>
impl_
;
...
...
source/libs/scalar/test/scalar/scalarTests.cpp
浏览文件 @
b421a5ec
...
...
@@ -41,6 +41,14 @@
namespace
{
SColumnInfo
createColumnInfo
(
int32_t
colId
,
int32_t
type
,
int32_t
bytes
)
{
SColumnInfo
info
=
{
0
};
info
.
colId
=
colId
;
info
.
type
=
type
;
info
.
bytes
=
bytes
;
return
info
;
}
int64_t
scltLeftV
=
21
,
scltRightV
=
10
;
double
scltLeftVd
=
21.0
,
scltRightVd
=
10.0
;
...
...
@@ -914,7 +922,7 @@ TEST(columnTest, smallint_value_add_int_column) {
SArray
*
blockList
=
taosArrayInit
(
2
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_DOUBLE
,
.
bytes
=
sizeof
(
double
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_DOUBLE
,
sizeof
(
double
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
true
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -954,7 +962,7 @@ TEST(columnTest, bigint_column_multi_binary_column) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_DOUBLE
,
.
bytes
=
sizeof
(
double
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_DOUBLE
,
sizeof
(
double
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -992,7 +1000,7 @@ TEST(columnTest, smallint_column_and_binary_column) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
bytes
=
sizeof
(
int64_t
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BIGINT
,
sizeof
(
int64_t
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1025,7 +1033,7 @@ TEST(columnTest, smallint_column_or_float_column) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
bytes
=
sizeof
(
int64_t
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BIGINT
,
sizeof
(
int64_t
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
true
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1058,7 +1066,7 @@ TEST(columnTest, smallint_column_or_double_value) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
bytes
=
sizeof
(
int64_t
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BIGINT
,
sizeof
(
int64_t
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
true
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1091,7 +1099,7 @@ TEST(columnTest, smallint_column_greater_double_value) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
true
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1131,7 +1139,7 @@ TEST(columnTest, int_column_in_double_list) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
true
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1190,7 +1198,7 @@ TEST(columnTest, binary_column_in_binary_list) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1234,7 +1242,7 @@ TEST(columnTest, binary_column_like_binary) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1276,7 +1284,7 @@ TEST(columnTest, binary_column_is_true) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1320,7 +1328,7 @@ TEST(columnTest, binary_column_is_null) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1363,7 +1371,7 @@ TEST(columnTest, binary_column_is_not_null) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
opNode
,
dataBlockId
,
slotId
,
opNode
);
...
...
@@ -1405,7 +1413,7 @@ TEST(columnTest, greater_and_lower) {
SArray
*
blockList
=
taosArrayInit
(
1
,
POINTER_BYTES
);
taosArrayPush
(
blockList
,
&
src
);
SColumnInfo
colInfo
=
{.
colId
=
1
,
.
type
=
TSDB_DATA_TYPE_BOOL
,
.
bytes
=
sizeof
(
bool
)}
;
SColumnInfo
colInfo
=
createColumnInfo
(
1
,
TSDB_DATA_TYPE_BOOL
,
sizeof
(
bool
))
;
int16_t
dataBlockId
=
0
,
slotId
=
0
;
scltAppendReservedSlot
(
blockList
,
&
dataBlockId
,
&
slotId
,
false
,
rowNum
,
&
colInfo
);
scltMakeTargetNode
(
&
logicNode
,
dataBlockId
,
slotId
,
logicNode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录