Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e30d114c
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看板
提交
e30d114c
编写于
4月 11, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set datablock desc timestamp precision
上级
cd75d112
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
38 deletion
+49
-38
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+4
-3
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+9
-9
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+1
-1
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+32
-23
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+1
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
e30d114c
...
...
@@ -84,6 +84,7 @@ typedef struct SVnodeModifLogicNode {
typedef
struct
SExchangeLogicNode
{
SLogicNode
node
;
int32_t
srcGroupId
;
uint8_t
precision
;
}
SExchangeLogicNode
;
typedef
enum
EWindowType
{
...
...
@@ -163,7 +164,7 @@ typedef struct SDataBlockDescNode {
SNodeList
*
pSlots
;
int32_t
totalRowSize
;
int32_t
outputRowSize
;
int16
_t
precision
;
uint8
_t
precision
;
}
SDataBlockDescNode
;
typedef
struct
SPhysiNode
{
...
...
@@ -253,11 +254,11 @@ typedef struct SWinodwPhysiNode {
SPhysiNode
node
;
SNodeList
*
pExprs
;
// these are expression list of parameter expression of function
SNodeList
*
pFuncs
;
SNode
*
pTspk
;
// timestamp primary key
}
SWinodwPhysiNode
;
typedef
struct
SIntervalPhysiNode
{
SWinodwPhysiNode
window
;
SNode
*
pTspk
;
// timestamp primary key
int64_t
interval
;
int64_t
offset
;
int64_t
sliding
;
...
...
@@ -274,7 +275,7 @@ typedef struct SMultiTableIntervalPhysiNode {
typedef
struct
SSessionWinodwPhysiNode
{
SWinodwPhysiNode
window
;
int64_t
gap
;
int64_t
gap
;
}
SSessionWinodwPhysiNode
;
typedef
struct
SStateWinodwPhysiNode
{
...
...
source/libs/command/src/explain.c
浏览文件 @
e30d114c
...
...
@@ -641,7 +641,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
}
case
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
:{
SIntervalPhysiNode
*
pIntNode
=
(
SIntervalPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_INTERVAL_FORMAT
,
nodesGetNameFromColumnNode
(
pIntNode
->
pTspk
));
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_INTERVAL_FORMAT
,
nodesGetNameFromColumnNode
(
pIntNode
->
window
.
pTspk
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_LEFT_PARENTHESIS_FORMAT
);
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
e30d114c
...
...
@@ -6916,7 +6916,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
.
precision
=
pIntervalPhyNode
->
precision
};
int32_t
primaryTsSlotId
=
((
SColumnNode
*
)
pIntervalPhyNode
->
pTspk
)
->
slotId
;
int32_t
primaryTsSlotId
=
((
SColumnNode
*
)
pIntervalPhyNode
->
window
.
pTspk
)
->
slotId
;
return
createIntervalOperatorInfo
(
op
,
pExprInfo
,
num
,
pResBlock
,
&
interval
,
primaryTsSlotId
,
pTableGroupInfo
,
pTaskInfo
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_SORT
==
type
)
{
SSortPhysiNode
*
pSortPhyNode
=
(
SSortPhysiNode
*
)
pPhyNode
;
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
e30d114c
...
...
@@ -65,7 +65,7 @@ const char* nodesNodeName(ENodeType type) {
case
QUERY_NODE_TARGET
:
return
"Target"
;
case
QUERY_NODE_DATABLOCK_DESC
:
return
"
Tuple
Desc"
;
return
"
DataBlock
Desc"
;
case
QUERY_NODE_SLOT_DESC
:
return
"SlotDesc"
;
case
QUERY_NODE_COLUMN_DEF
:
...
...
@@ -1060,6 +1060,7 @@ static int32_t jsonToPhysiSortNode(const SJson* pJson, void* pObj) {
static
const
char
*
jkWindowPhysiPlanExprs
=
"Exprs"
;
static
const
char
*
jkWindowPhysiPlanFuncs
=
"Funcs"
;
static
const
char
*
jkWindowPhysiPlanTsPk
=
"TsPk"
;
static
int32_t
physiWindowNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SWinodwPhysiNode
*
pNode
=
(
const
SWinodwPhysiNode
*
)
pObj
;
...
...
@@ -1071,6 +1072,9 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodeListToJson
(
pJson
,
jkWindowPhysiPlanFuncs
,
pNode
->
pFuncs
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddObject
(
pJson
,
jkWindowPhysiPlanTsPk
,
nodeToJson
,
pNode
->
pTspk
);
}
return
code
;
}
...
...
@@ -1085,6 +1089,9 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeList
(
pJson
,
jkWindowPhysiPlanFuncs
,
&
pNode
->
pFuncs
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeObject
(
pJson
,
jkWindowPhysiPlanTsPk
,
(
SNode
**
)
&
pNode
->
pTspk
);
}
return
code
;
}
...
...
@@ -1095,7 +1102,6 @@ static const char* jkIntervalPhysiPlanSliding = "Sliding";
static
const
char
*
jkIntervalPhysiPlanIntervalUnit
=
"intervalUnit"
;
static
const
char
*
jkIntervalPhysiPlanSlidingUnit
=
"slidingUnit"
;
static
const
char
*
jkIntervalPhysiPlanFill
=
"Fill"
;
static
const
char
*
jkIntervalPhysiPlanTsPk
=
"TsPk"
;
static
const
char
*
jkIntervalPhysiPlanPrecision
=
"Precision"
;
static
int32_t
physiIntervalNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
...
...
@@ -1120,9 +1126,6 @@ static int32_t physiIntervalNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddObject
(
pJson
,
jkIntervalPhysiPlanFill
,
nodeToJson
,
pNode
->
pFill
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddObject
(
pJson
,
jkIntervalPhysiPlanTsPk
,
nodeToJson
,
pNode
->
pTspk
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkIntervalPhysiPlanPrecision
,
pNode
->
precision
);
}
...
...
@@ -1152,9 +1155,6 @@ static int32_t jsonToPhysiIntervalNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeObject
(
pJson
,
jkIntervalPhysiPlanFill
,
(
SNode
**
)
&
pNode
->
pFill
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeObject
(
pJson
,
jkIntervalPhysiPlanTsPk
,
(
SNode
**
)
&
pNode
->
pTspk
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetUTinyIntValue
(
pJson
,
jkIntervalPhysiPlanPrecision
,
&
pNode
->
precision
);
}
...
...
@@ -2291,7 +2291,7 @@ static int32_t jsonToDataBlockDescNode(const SJson* pJson, void* pObj) {
code
=
jsonToNodeList
(
pJson
,
jkDataBlockDescSlots
,
&
pNode
->
pSlots
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGet
Small
IntValue
(
pJson
,
jkDataBlockPrecision
,
&
pNode
->
precision
);
code
=
tjsonGet
UTiny
IntValue
(
pJson
,
jkDataBlockPrecision
,
&
pNode
->
precision
);
}
return
code
;
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
e30d114c
...
...
@@ -252,6 +252,7 @@ static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) {
destroyPhysiNode
((
SPhysiNode
*
)
pNode
);
nodesDestroyList
(
pNode
->
pExprs
);
nodesDestroyList
(
pNode
->
pFuncs
);
nodesDestroyNode
(
pNode
->
pTspk
);
}
static
void
destroyScanPhysiNode
(
SScanPhysiNode
*
pNode
)
{
...
...
@@ -593,7 +594,6 @@ void nodesDestroyNode(SNodeptr pNode) {
SIntervalPhysiNode
*
pPhyNode
=
(
SIntervalPhysiNode
*
)
pNode
;
destroyWinodwPhysiNode
((
SWinodwPhysiNode
*
)
pPhyNode
);
nodesDestroyNode
(
pPhyNode
->
pFill
);
nodesDestroyNode
(
pPhyNode
->
pTspk
);
break
;
}
case
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
:
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
e30d114c
...
...
@@ -316,7 +316,18 @@ static int32_t setListSlotId(SPhysiPlanContext* pCxt, int16_t leftDataBlockId, i
return
TSDB_CODE_SUCCESS
;
}
static
SPhysiNode
*
makePhysiNode
(
SPhysiPlanContext
*
pCxt
,
SLogicNode
*
pLogicNode
,
ENodeType
type
)
{
static
uint8_t
getPrecision
(
SNodeList
*
pChildren
)
{
if
(
1
==
LIST_LENGTH
(
pChildren
))
{
return
(((
SPhysiNode
*
)
nodesListGetNode
(
pChildren
,
0
))
->
pOutputDataBlockDesc
)
->
precision
;
}
else
if
(
2
==
LIST_LENGTH
(
pChildren
))
{
uint8_t
lp
=
(((
SPhysiNode
*
)
nodesListGetNode
(
pChildren
,
0
))
->
pOutputDataBlockDesc
)
->
precision
;
uint8_t
rp
=
(((
SPhysiNode
*
)
nodesListGetNode
(
pChildren
,
1
))
->
pOutputDataBlockDesc
)
->
precision
;
return
(
lp
>
rp
?
rp
:
lp
);
}
return
0
;
}
static
SPhysiNode
*
makePhysiNode
(
SPhysiPlanContext
*
pCxt
,
uint8_t
precision
,
SLogicNode
*
pLogicNode
,
ENodeType
type
)
{
SPhysiNode
*
pPhysiNode
=
(
SPhysiNode
*
)
nodesMakeNode
(
type
);
if
(
NULL
==
pPhysiNode
)
{
return
NULL
;
...
...
@@ -327,6 +338,7 @@ static SPhysiNode* makePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode
nodesDestroyNode
(
pPhysiNode
);
return
NULL
;
}
pPhysiNode
->
pOutputDataBlockDesc
->
precision
=
precision
;
return
pPhysiNode
;
}
...
...
@@ -405,7 +417,7 @@ static void vgroupInfoToNodeAddr(const SVgroupInfo* vg, SQueryNodeAddr* pNodeAdd
}
static
int32_t
createTagScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
STagScanPhysiNode
*
pTagScan
=
(
STagScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
);
STagScanPhysiNode
*
pTagScan
=
(
STagScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
pScanLogicNode
->
pMeta
->
tableInfo
.
precision
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
);
if
(
NULL
==
pTagScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -413,7 +425,7 @@ static int32_t createTagScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* p
}
static
int32_t
createTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
STableScanPhysiNode
*
pTableScan
=
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
);
STableScanPhysiNode
*
pTableScan
=
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
pScanLogicNode
->
pMeta
->
tableInfo
.
precision
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
);
if
(
NULL
==
pTableScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -430,7 +442,7 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp
}
static
int32_t
createSystemTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SSystemTableScanPhysiNode
*
pScan
=
(
SSystemTableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
);
SSystemTableScanPhysiNode
*
pScan
=
(
SSystemTableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
pScanLogicNode
->
pMeta
->
tableInfo
.
precision
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN
);
if
(
NULL
==
pScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -451,7 +463,7 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan*
}
static
int32_t
createStreamScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SStreamScanPhysiNode
*
pScan
=
(
SStreamScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
);
SStreamScanPhysiNode
*
pScan
=
(
SStreamScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
pScanLogicNode
->
pMeta
->
tableInfo
.
precision
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
);
if
(
NULL
==
pScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -515,7 +527,7 @@ static int32_t createJoinOutputCols(SPhysiPlanContext* pCxt, SDataBlockDescNode*
}
static
int32_t
createJoinPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SJoinLogicNode
*
pJoinLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SJoinPhysiNode
*
pJoin
=
(
SJoinPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pJoinLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_JOIN
);
SJoinPhysiNode
*
pJoin
=
(
SJoinPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pJoinLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_JOIN
);
if
(
NULL
==
pJoin
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -656,7 +668,7 @@ static int32_t rewritePrecalcExpr(SPhysiPlanContext* pCxt, SNode* pNode, SNodeLi
}
static
int32_t
createAggPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SAggLogicNode
*
pAggLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SAggPhysiNode
*
pAgg
=
(
SAggPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pAggLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_AGG
);
SAggPhysiNode
*
pAgg
=
(
SAggPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pAggLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_AGG
);
if
(
NULL
==
pAgg
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -710,7 +722,7 @@ static int32_t createAggPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren,
}
static
int32_t
createProjectPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SProjectLogicNode
*
pProjectLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SProjectPhysiNode
*
pProject
=
(
SProjectPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pProjectLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
);
SProjectPhysiNode
*
pProject
=
(
SProjectPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pProjectLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_PROJECT
);
if
(
NULL
==
pProject
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -738,18 +750,18 @@ static int32_t createProjectPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChild
}
static
int32_t
doCreateExchangePhysiNode
(
SPhysiPlanContext
*
pCxt
,
SExchangeLogicNode
*
pExchangeLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SExchangePhysiNode
*
pExchange
=
(
SExchangePhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pExchangeLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
);
SExchangePhysiNode
*
pExchange
=
(
SExchangePhysiNode
*
)
makePhysiNode
(
pCxt
,
pExchangeLogicNode
->
precision
,
(
SLogicNode
*
)
pExchangeLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
);
if
(
NULL
==
pExchange
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pExchange
->
srcGroupId
=
pExchangeLogicNode
->
srcGroupId
;
*
pPhyNode
=
(
SPhysiNode
*
)
pExchange
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
createStreamScanPhysiNodeByExchange
(
SPhysiPlanContext
*
pCxt
,
SExchangeLogicNode
*
pExchangeLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SStreamScanPhysiNode
*
pScan
=
(
SStreamScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pExchangeLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
);
SStreamScanPhysiNode
*
pScan
=
(
SStreamScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
pExchangeLogicNode
->
precision
,
(
SLogicNode
*
)
pExchangeLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
);
if
(
NULL
==
pScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -803,6 +815,10 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList*
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
setNodeSlotId
(
pCxt
,
pChildTupe
->
dataBlockId
,
-
1
,
pWindowLogicNode
->
pTspk
,
&
pWindow
->
pTspk
);
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
NULL
!=
pFuncs
)
{
code
=
setListSlotId
(
pCxt
,
pChildTupe
->
dataBlockId
,
-
1
,
pFuncs
,
&
pWindow
->
pFuncs
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
@@ -820,7 +836,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList*
}
static
int32_t
createIntervalPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SWindowLogicNode
*
pWindowLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SIntervalPhysiNode
*
pInterval
=
(
SIntervalPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
);
SIntervalPhysiNode
*
pInterval
=
(
SIntervalPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
);
if
(
NULL
==
pInterval
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -838,18 +854,11 @@ static int32_t createIntervalPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChil
return
TSDB_CODE_OUT_OF_MEMORY
;
}
SDataBlockDescNode
*
pChildTupe
=
(((
SPhysiNode
*
)
nodesListGetNode
(
pChildren
,
0
))
->
pOutputDataBlockDesc
);
int32_t
code
=
setNodeSlotId
(
pCxt
,
pChildTupe
->
dataBlockId
,
-
1
,
pWindowLogicNode
->
pTspk
,
&
pInterval
->
pTspk
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
nodesDestroyNode
(
pInterval
);
return
code
;
}
return
createWindowPhysiNodeFinalize
(
pCxt
,
pChildren
,
&
pInterval
->
window
,
pWindowLogicNode
,
pPhyNode
);
}
static
int32_t
createSessionWindowPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SWindowLogicNode
*
pWindowLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SSessionWinodwPhysiNode
*
pSession
=
(
SSessionWinodwPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
);
SSessionWinodwPhysiNode
*
pSession
=
(
SSessionWinodwPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
);
if
(
NULL
==
pSession
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -860,7 +869,7 @@ static int32_t createSessionWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList*
}
static
int32_t
createStateWindowPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SWindowLogicNode
*
pWindowLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SStateWinodwPhysiNode
*
pState
=
(
SStateWinodwPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW
);
SStateWinodwPhysiNode
*
pState
=
(
SStateWinodwPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pWindowLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_STATE_WINDOW
);
if
(
NULL
==
pState
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -908,7 +917,7 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr
}
static
int32_t
createSortPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SSortLogicNode
*
pSortLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SSortPhysiNode
*
pSort
=
(
SSortPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pSortLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SORT
);
SSortPhysiNode
*
pSort
=
(
SSortPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pSortLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_SORT
);
if
(
NULL
==
pSort
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -947,7 +956,7 @@ static int32_t createSortPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren
}
static
int32_t
createPartitionPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SNodeList
*
pChildren
,
SPartitionLogicNode
*
pPartLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SPartitionPhysiNode
*
pPart
=
(
SPartitionPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pPartLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_PARTITION
);
SPartitionPhysiNode
*
pPart
=
(
SPartitionPhysiNode
*
)
makePhysiNode
(
pCxt
,
getPrecision
(
pChildren
),
(
SLogicNode
*
)
pPartLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_PARTITION
);
if
(
NULL
==
pPart
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
e30d114c
...
...
@@ -103,6 +103,7 @@ static int32_t stsCreateExchangeNode(SSplitContext* pCxt, SLogicSubplan* pSubpla
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pExchange
->
srcGroupId
=
pCxt
->
groupId
;
pExchange
->
precision
=
pScan
->
pMeta
->
tableInfo
.
precision
;
pExchange
->
node
.
pTargets
=
nodesCloneList
(
pScan
->
node
.
pTargets
);
if
(
NULL
==
pExchange
->
node
.
pTargets
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录