Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2d85d019
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2d85d019
编写于
2月 21, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: add vgroup count
上级
c90e2aa7
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
75 addition
and
67 deletion
+75
-67
include/common/tcommon.h
include/common/tcommon.h
+10
-9
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+37
-35
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+28
-23
未找到文件。
include/common/tcommon.h
浏览文件 @
2d85d019
...
...
@@ -300,6 +300,7 @@ typedef struct STableBlockDistInfo {
int32_t
firstSeekTimeUs
;
uint32_t
numOfInmemRows
;
uint32_t
numOfSmallBlocks
;
uint32_t
numOfVgroups
;
int32_t
blockRowsHisto
[
20
];
}
STableBlockDistInfo
;
...
...
source/libs/executor/src/sysscanoperator.c
浏览文件 @
2d85d019
...
...
@@ -350,8 +350,8 @@ static int32_t optSysMergeRslt(SArray* mRslt, SArray* rslt);
static
SSDataBlock
*
sysTableScanFromMNode
(
SOperatorInfo
*
pOperator
,
SSysTableScanInfo
*
pInfo
,
const
char
*
name
,
SExecTaskInfo
*
pTaskInfo
);
void
extractTbnameSlotId
(
SSysTableScanInfo
*
pInfo
,
const
SScanPhysiNode
*
pScanNode
);
static
void
sysTableScanFillTbName
(
SOperatorInfo
*
pOperator
,
const
SSysTableScanInfo
*
pInfo
,
const
char
*
name
,
SSDataBlock
*
pBlock
);
static
void
sysTableScanFillTbName
(
SOperatorInfo
*
pOperator
,
const
SSysTableScanInfo
*
pInfo
,
const
char
*
name
,
SSDataBlock
*
pBlock
);
__optSysFilter
optSysGetFilterFunc
(
int32_t
ctype
,
bool
*
reverse
)
{
if
(
ctype
==
OP_TYPE_LOWER_EQUAL
||
ctype
==
OP_TYPE_LOWER_THAN
)
{
*
reverse
=
true
;
...
...
@@ -516,7 +516,8 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
metaTbCursorPrev
(
pInfo
->
pCur
);
blockFull
=
true
;
}
else
{
sysTableUserTagsFillOneTableTags
(
pInfo
,
&
smrSuperTable
,
&
pInfo
->
pCur
->
mr
,
dbname
,
tableName
,
&
numOfRows
,
dataBlock
);
sysTableUserTagsFillOneTableTags
(
pInfo
,
&
smrSuperTable
,
&
pInfo
->
pCur
->
mr
,
dbname
,
tableName
,
&
numOfRows
,
dataBlock
);
}
metaReaderClear
(
&
smrSuperTable
);
...
...
@@ -1343,7 +1344,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
setOperatorCompleted
(
pOperator
);
}
return
pBlock
->
info
.
rows
>
0
?
pBlock
:
NULL
;
return
pBlock
->
info
.
rows
>
0
?
pBlock
:
NULL
;
}
else
{
return
NULL
;
}
...
...
@@ -1489,10 +1490,11 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan
setOperatorInfo
(
pOperator
,
"SysTableScanOperator"
,
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
pOperator
->
exprSupp
.
numOfExprs
=
taosArrayGetSize
(
pInfo
->
pRes
->
pDataBlock
);
pOperator
->
fpSet
=
createOperatorFpSet
(
optrDummyOpenFn
,
doSysTableScan
,
NULL
,
destroySysScanOperator
,
optrDefaultBufFn
,
NULL
);
pOperator
->
fpSet
=
createOperatorFpSet
(
optrDummyOpenFn
,
doSysTableScan
,
NULL
,
destroySysScanOperator
,
optrDefaultBufFn
,
NULL
);
return
pOperator
;
_error:
_error:
if
(
pInfo
!=
NULL
)
{
destroySysScanOperator
(
pInfo
);
}
...
...
@@ -2001,7 +2003,7 @@ SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDi
}
pInfo
->
readHandle
=
*
readHandle
;
pInfo
->
uid
=
(
pBlockScanNode
->
suid
!=
0
)
?
pBlockScanNode
->
suid
:
pBlockScanNode
->
uid
;
pInfo
->
uid
=
(
pBlockScanNode
->
suid
!=
0
)
?
pBlockScanNode
->
suid
:
pBlockScanNode
->
uid
;
int32_t
numOfCols
=
0
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pBlockScanNode
->
pScanPseudoCols
,
NULL
,
&
numOfCols
);
...
...
@@ -2012,8 +2014,8 @@ SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDi
setOperatorInfo
(
pOperator
,
"DataBlockDistScanOperator"
,
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
pOperator
->
fpSet
=
createOperatorFpSet
(
optrDummyOpenFn
,
doBlockInfoScan
,
NULL
,
destroyBlockDistScanOperatorInfo
,
optrDefaultBufFn
,
NULL
);
pOperator
->
fpSet
=
createOperatorFpSet
(
optrDummyOpenFn
,
doBlockInfoScan
,
NULL
,
destroyBlockDistScanOperatorInfo
,
optrDefaultBufFn
,
NULL
);
return
pOperator
;
_error:
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
2d85d019
...
...
@@ -795,7 +795,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
((
int64_t
*
)
pCol
->
pData
)[
currentRow
]
=
pRes
->
v
;
// colDataAppendInt64(pCol, currentRow, &pRes->v);
// colDataAppendInt64(pCol, currentRow, &pRes->v);
break
;
case
TSDB_DATA_TYPE_UINT
:
case
TSDB_DATA_TYPE_INT
:
...
...
@@ -2123,7 +2123,8 @@ int32_t firstFunction(SqlFunctionCtx* pCtx) {
}
// All null data column, return directly.
if
(
pInput
->
colDataSMAIsSet
&&
(
pInput
->
pColumnDataAgg
[
0
]
->
numOfNull
==
pInput
->
totalRows
)
&&
pInputCol
->
hasNull
==
true
)
{
if
(
pInput
->
colDataSMAIsSet
&&
(
pInput
->
pColumnDataAgg
[
0
]
->
numOfNull
==
pInput
->
totalRows
)
&&
pInputCol
->
hasNull
==
true
)
{
// save selectivity value for column consisted of all null values
int32_t
code
=
firstlastSaveTupleData
(
pCtx
->
pSrcBlock
,
pInput
->
startRowIndex
,
pCtx
,
pInfo
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -2239,7 +2240,8 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
}
// All null data column, return directly.
if
(
pInput
->
colDataSMAIsSet
&&
(
pInput
->
pColumnDataAgg
[
0
]
->
numOfNull
==
pInput
->
totalRows
)
&&
pInputCol
->
hasNull
==
true
)
{
if
(
pInput
->
colDataSMAIsSet
&&
(
pInput
->
pColumnDataAgg
[
0
]
->
numOfNull
==
pInput
->
totalRows
)
&&
pInputCol
->
hasNull
==
true
)
{
// save selectivity value for column consisted of all null values
int32_t
code
=
firstlastSaveTupleData
(
pCtx
->
pSrcBlock
,
pInput
->
startRowIndex
,
pCtx
,
pInfo
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -2875,8 +2877,8 @@ static STopBotRes* getTopBotOutputInfo(SqlFunctionCtx* pCtx) {
return
pRes
;
}
static
int32_t
doAddIntoResult
(
SqlFunctionCtx
*
pCtx
,
void
*
pData
,
int32_t
rowIndex
,
SSDataBlock
*
pSrcBlock
,
uint16_t
type
,
uint64_t
uid
,
SResultRowEntryInfo
*
pEntryInfo
,
bool
isTopQuery
);
static
int32_t
doAddIntoResult
(
SqlFunctionCtx
*
pCtx
,
void
*
pData
,
int32_t
rowIndex
,
SSDataBlock
*
pSrcBlock
,
uint
16_t
type
,
uint
64_t
uid
,
SResultRowEntryInfo
*
pEntryInfo
,
bool
isTopQuery
);
static
void
addResult
(
SqlFunctionCtx
*
pCtx
,
STopBotResItem
*
pSourceItem
,
int16_t
type
,
bool
isTopQuery
);
...
...
@@ -5410,6 +5412,7 @@ int32_t blockDistFunction(SqlFunctionCtx* pCtx) {
if
(
pDistInfo
->
maxRows
<
p1
.
maxRows
)
{
pDistInfo
->
maxRows
=
p1
.
maxRows
;
}
pDistInfo
->
numOfVgroups
+=
(
p1
.
numOfTables
!=
0
?
1
:
0
);
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pDistInfo
->
blockRowsHisto
);
++
i
)
{
pDistInfo
->
blockRowsHisto
[
i
]
+=
p1
.
blockRowsHisto
[
i
];
...
...
@@ -5438,6 +5441,7 @@ int32_t tSerializeBlockDistInfo(void* buf, int32_t bufLen, const STableBlockDist
if
(
tEncodeI32
(
&
encoder
,
pInfo
->
defMinRows
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pInfo
->
numOfInmemRows
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pInfo
->
numOfSmallBlocks
)
<
0
)
return
-
1
;
if
(
tEncodeU32
(
&
encoder
,
pInfo
->
numOfVgroups
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pInfo
->
blockRowsHisto
);
++
i
)
{
if
(
tEncodeI32
(
&
encoder
,
pInfo
->
blockRowsHisto
[
i
])
<
0
)
return
-
1
;
...
...
@@ -5469,6 +5473,7 @@ int32_t tDeserializeBlockDistInfo(void* buf, int32_t bufLen, STableBlockDistInfo
if
(
tDecodeI32
(
&
decoder
,
&
pInfo
->
defMinRows
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pInfo
->
numOfInmemRows
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pInfo
->
numOfSmallBlocks
)
<
0
)
return
-
1
;
if
(
tDecodeU32
(
&
decoder
,
&
pInfo
->
numOfVgroups
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
tListLen
(
pInfo
->
blockRowsHisto
);
++
i
)
{
if
(
tDecodeI32
(
&
decoder
,
&
pInfo
->
blockRowsHisto
[
i
])
<
0
)
return
-
1
;
...
...
@@ -5520,7 +5525,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
colDataAppend
(
pColInfo
,
row
++
,
st
,
false
);
len
=
sprintf
(
st
+
VARSTR_HEADER_SIZE
,
"Total_Tables=[%d] Total_Files=[%d] Total_Vgroups=[%d]"
,
pData
->
numOfTables
,
pData
->
numOfFiles
,
0
);
pData
->
numOfFiles
,
pData
->
numOfVgroups
);
varDataSetLen
(
st
,
len
);
colDataAppend
(
pColInfo
,
row
++
,
st
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录