Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a06a1fb3
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看板
提交
a06a1fb3
编写于
4月 26, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]refactor
上级
2101466d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
40 deletion
+44
-40
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+0
-2
src/common/src/tvariant.c
src/common/src/tvariant.c
+7
-0
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+4
-5
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+30
-30
src/query/src/qPlan.c
src/query/src/qPlan.c
+3
-3
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
a06a1fb3
...
@@ -6505,7 +6505,6 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
...
@@ -6505,7 +6505,6 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
size_t
valSize
=
taosArrayGetSize
(
pValList
);
size_t
valSize
=
taosArrayGetSize
(
pValList
);
// too long tag values will return invalid sql, not be truncated automatically
// too long tag values will return invalid sql, not be truncated automatically
SSchema
*
pTagSchema
=
tscGetTableTagSchema
(
pStableMetaInfo
->
pTableMeta
);
SSchema
*
pTagSchema
=
tscGetTableTagSchema
(
pStableMetaInfo
->
pTableMeta
);
STagData
*
pTag
=
&
pCreateTableInfo
->
tagdata
;
STagData
*
pTag
=
&
pCreateTableInfo
->
tagdata
;
...
@@ -6515,7 +6514,6 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
...
@@ -6515,7 +6514,6 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
SArray
*
pNameList
=
NULL
;
SArray
*
pNameList
=
NULL
;
size_t
nameSize
=
0
;
size_t
nameSize
=
0
;
int32_t
schemaSize
=
tscGetNumOfTags
(
pStableMetaInfo
->
pTableMeta
);
int32_t
schemaSize
=
tscGetNumOfTags
(
pStableMetaInfo
->
pTableMeta
);
...
...
src/common/src/tvariant.c
浏览文件 @
a06a1fb3
...
@@ -48,6 +48,13 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
...
@@ -48,6 +48,13 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
case
TSDB_DATA_TYPE_INT
:{
case
TSDB_DATA_TYPE_INT
:{
ret
=
tStrToInteger
(
token
->
z
,
token
->
type
,
token
->
n
,
&
pVar
->
i64
,
true
);
ret
=
tStrToInteger
(
token
->
z
,
token
->
type
,
token
->
n
,
&
pVar
->
i64
,
true
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
SStrToken
t
=
{
0
};
tSQLGetToken
(
token
->
z
,
&
t
.
type
);
if
(
t
.
type
==
TK_MINUS
)
{
// it is a signed number which is greater than INT64_MAX or less than INT64_MIN
pVar
->
nType
=
-
1
;
// -1 means error type
return
;
}
// data overflow, try unsigned parse the input number
// data overflow, try unsigned parse the input number
ret
=
tStrToInteger
(
token
->
z
,
token
->
type
,
token
->
n
,
&
pVar
->
i64
,
false
);
ret
=
tStrToInteger
(
token
->
z
,
token
->
type
,
token
->
n
,
&
pVar
->
i64
,
false
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
...
...
src/query/inc/qExecutor.h
浏览文件 @
a06a1fb3
...
@@ -266,7 +266,6 @@ typedef struct SQueryRuntimeEnv {
...
@@ -266,7 +266,6 @@ typedef struct SQueryRuntimeEnv {
SSDataBlock
*
outputBuf
;
SSDataBlock
*
outputBuf
;
STableGroupInfo
tableqinfoGroupInfo
;
// this is a group array list, including SArray<STableQueryInfo*> structure
STableGroupInfo
tableqinfoGroupInfo
;
// this is a group array list, including SArray<STableQueryInfo*> structure
struct
SOperatorInfo
*
proot
;
struct
SOperatorInfo
*
proot
;
struct
SOperatorInfo
*
pTableScanner
;
// table scan operator
SGroupResInfo
groupResInfo
;
SGroupResInfo
groupResInfo
;
int64_t
currentOffset
;
// dynamic offset value
int64_t
currentOffset
;
// dynamic offset value
...
@@ -300,7 +299,7 @@ enum OPERATOR_TYPE_E {
...
@@ -300,7 +299,7 @@ enum OPERATOR_TYPE_E {
OP_DummyInput
=
16
,
//TODO remove it after fully refactor.
OP_DummyInput
=
16
,
//TODO remove it after fully refactor.
OP_MultiwaySort
=
17
,
// multi-way data merge into one input stream.
OP_MultiwaySort
=
17
,
// multi-way data merge into one input stream.
OP_GlobalAggregate
=
18
,
// global merge for the multi-way data sources.
OP_GlobalAggregate
=
18
,
// global merge for the multi-way data sources.
OP_
Condition
=
19
,
OP_
Filter
=
19
,
};
};
typedef
struct
SOperatorInfo
{
typedef
struct
SOperatorInfo
{
...
@@ -437,10 +436,10 @@ typedef struct SSLimitOperatorInfo {
...
@@ -437,10 +436,10 @@ typedef struct SSLimitOperatorInfo {
SArray
*
orderColumnList
;
SArray
*
orderColumnList
;
}
SSLimitOperatorInfo
;
}
SSLimitOperatorInfo
;
typedef
struct
S
Condition
OperatorInfo
{
typedef
struct
S
Filter
OperatorInfo
{
SSingleColumnFilterInfo
*
pFilterInfo
;
SSingleColumnFilterInfo
*
pFilterInfo
;
int32_t
numOfFilterCols
;
int32_t
numOfFilterCols
;
}
S
Condition
OperatorInfo
;
}
S
Filter
OperatorInfo
;
typedef
struct
SFillOperatorInfo
{
typedef
struct
SFillOperatorInfo
{
SFillInfo
*
pFillInfo
;
SFillInfo
*
pFillInfo
;
...
@@ -504,7 +503,7 @@ SOperatorInfo* createMultiwaySortOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SEx
...
@@ -504,7 +503,7 @@ SOperatorInfo* createMultiwaySortOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SEx
int32_t
numOfRows
,
void
*
merger
,
bool
groupMix
);
int32_t
numOfRows
,
void
*
merger
,
bool
groupMix
);
SOperatorInfo
*
createGlobalAggregateOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
void
*
param
);
SOperatorInfo
*
createGlobalAggregateOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
void
*
param
);
SOperatorInfo
*
createSLimitOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
void
*
merger
);
SOperatorInfo
*
createSLimitOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
void
*
merger
);
SOperatorInfo
*
create
Condition
OperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
SOperatorInfo
*
create
Filter
OperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
SSDataBlock
*
doGlobalAggregate
(
void
*
param
,
bool
*
newgroup
);
SSDataBlock
*
doGlobalAggregate
(
void
*
param
,
bool
*
newgroup
);
SSDataBlock
*
doMultiwayMergeSort
(
void
*
param
,
bool
*
newgroup
);
SSDataBlock
*
doMultiwayMergeSort
(
void
*
param
,
bool
*
newgroup
);
...
...
src/query/src/qExecutor.c
浏览文件 @
a06a1fb3
...
@@ -1707,49 +1707,49 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
...
@@ -1707,49 +1707,49 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
}
}
case
OP_MultiTableTimeInterval
:
{
case
OP_MultiTableTimeInterval
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createMultiTableTimeIntervalOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createMultiTableTimeIntervalOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
break
;
break
;
}
}
case
OP_TimeWindow
:
{
case
OP_TimeWindow
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createTimeIntervalOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createTimeIntervalOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
break
;
break
;
}
}
case
OP_Groupby
:
{
case
OP_Groupby
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createGroupbyOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createGroupbyOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
break
;
break
;
}
}
case
OP_SessionWindow
:
{
case
OP_SessionWindow
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createSWindowOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createSWindowOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
break
;
break
;
}
}
case
OP_MultiTableAggregate
:
{
case
OP_MultiTableAggregate
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createMultiTableAggOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createMultiTableAggOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
break
;
break
;
}
}
case
OP_Aggregate
:
{
case
OP_Aggregate
:
{
pRuntimeEnv
->
proot
=
pRuntimeEnv
->
proot
=
createAggregateOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
TableScanner
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
createAggregateOperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
p
root
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
if
(
pRuntimeEnv
->
p
TableScanner
->
operatorType
!=
OP_DummyInput
)
{
if
(
pRuntimeEnv
->
p
root
->
upstream
->
operatorType
!=
OP_DummyInput
)
{
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
TableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
pRuntimeEnv
->
p
root
->
upstream
->
info
,
pRuntimeEnv
->
proot
);
}
}
break
;
break
;
}
}
case
OP_Arithmetic
:
{
// TODO refactor to remove arith operator.
case
OP_Arithmetic
:
{
// TODO refactor to remove arith operator.
SOperatorInfo
*
prev
=
pRuntimeEnv
->
p
TableScanner
;
SOperatorInfo
*
prev
=
pRuntimeEnv
->
p
root
;
if
(
i
==
0
)
{
if
(
i
==
0
)
{
pRuntimeEnv
->
proot
=
createArithOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
pRuntimeEnv
->
proot
=
createArithOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
if
(
pRuntimeEnv
->
p
TableScanner
!=
NULL
&&
pRuntimeEnv
->
pTableScanner
->
operatorType
!=
OP_DummyInput
)
{
// TODO refactor
if
(
pRuntimeEnv
->
p
root
!=
NULL
&&
pRuntimeEnv
->
proot
->
operatorType
!=
OP_DummyInput
)
{
// TODO refactor
setTableScanFilterOperatorInfo
(
p
RuntimeEnv
->
pTableScanner
->
info
,
pRuntimeEnv
->
proot
);
setTableScanFilterOperatorInfo
(
p
rev
->
info
,
pRuntimeEnv
->
proot
);
}
}
}
else
{
}
else
{
prev
=
pRuntimeEnv
->
proot
;
prev
=
pRuntimeEnv
->
proot
;
...
@@ -1764,12 +1764,12 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
...
@@ -1764,12 +1764,12 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
break
;
break
;
}
}
case
OP_
Condition
:
{
// todo refactor
case
OP_
Filter
:
{
// todo refactor
assert
(
pQueryAttr
->
havingNum
>
0
);
assert
(
pQueryAttr
->
havingNum
>
0
);
if
(
pQueryAttr
->
stableQuery
)
{
if
(
pQueryAttr
->
stableQuery
)
{
pRuntimeEnv
->
proot
=
create
Condition
OperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
proot
,
pQueryAttr
->
pExpr3
,
pQueryAttr
->
numOfExpr3
);
pRuntimeEnv
->
proot
=
create
Filter
OperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
proot
,
pQueryAttr
->
pExpr3
,
pQueryAttr
->
numOfExpr3
);
}
else
{
}
else
{
pRuntimeEnv
->
proot
=
create
Condition
OperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
proot
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
pRuntimeEnv
->
proot
=
create
Filter
OperatorInfo
(
pRuntimeEnv
,
pRuntimeEnv
->
proot
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
);
}
}
break
;
break
;
}
}
...
@@ -4019,19 +4019,19 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, SArray* prevResult, void* ts
...
@@ -4019,19 +4019,19 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, SArray* prevResult, void* ts
switch
(
tbScanner
)
{
switch
(
tbScanner
)
{
case
OP_TableBlockInfoScan
:
{
case
OP_TableBlockInfoScan
:
{
pRuntimeEnv
->
p
TableScanner
=
createTableBlockInfoScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
pRuntimeEnv
->
p
root
=
createTableBlockInfoScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
break
;
break
;
}
}
case
OP_TableSeqScan
:
{
case
OP_TableSeqScan
:
{
pRuntimeEnv
->
p
TableScanner
=
createTableSeqScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
pRuntimeEnv
->
p
root
=
createTableSeqScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
break
;
break
;
}
}
case
OP_DataBlocksOptScan
:
{
case
OP_DataBlocksOptScan
:
{
pRuntimeEnv
->
p
TableScanner
=
createDataBlocksOptScanInfo
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
getNumOfScanTimes
(
pQueryAttr
),
1
);
pRuntimeEnv
->
p
root
=
createDataBlocksOptScanInfo
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
getNumOfScanTimes
(
pQueryAttr
),
1
);
break
;
break
;
}
}
case
OP_TableScan
:
{
case
OP_TableScan
:
{
pRuntimeEnv
->
p
TableScanner
=
createTableScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
getNumOfScanTimes
(
pQueryAttr
));
pRuntimeEnv
->
p
root
=
createTableScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
getNumOfScanTimes
(
pQueryAttr
));
break
;
break
;
}
}
default:
{
// do nothing
default:
{
// do nothing
...
@@ -4040,8 +4040,8 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, SArray* prevResult, void* ts
...
@@ -4040,8 +4040,8 @@ int32_t doInitQInfo(SQInfo* pQInfo, STSBuf* pTsBuf, SArray* prevResult, void* ts
}
}
if
(
sourceOptr
!=
NULL
)
{
if
(
sourceOptr
!=
NULL
)
{
assert
(
pRuntimeEnv
->
p
TableScanner
==
NULL
);
assert
(
pRuntimeEnv
->
p
root
==
NULL
);
pRuntimeEnv
->
p
TableScanner
=
sourceOptr
;
pRuntimeEnv
->
p
root
=
sourceOptr
;
}
}
if
(
pTsBuf
!=
NULL
)
{
if
(
pTsBuf
!=
NULL
)
{
...
@@ -4911,7 +4911,7 @@ static SSDataBlock* doFilter(void* param, bool* newgroup) {
...
@@ -4911,7 +4911,7 @@ static SSDataBlock* doFilter(void* param, bool* newgroup) {
return
NULL
;
return
NULL
;
}
}
S
Condition
OperatorInfo
*
pCondInfo
=
pOperator
->
info
;
S
Filter
OperatorInfo
*
pCondInfo
=
pOperator
->
info
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
while
(
1
)
{
while
(
1
)
{
...
@@ -5334,7 +5334,7 @@ static void destroyTagScanOperatorInfo(void* param, int32_t numOfOutput) {
...
@@ -5334,7 +5334,7 @@ static void destroyTagScanOperatorInfo(void* param, int32_t numOfOutput) {
}
}
static
void
destroyConditionOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
static
void
destroyConditionOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
S
ConditionOperatorInfo
*
pInfo
=
(
SCondition
OperatorInfo
*
)
param
;
S
FilterOperatorInfo
*
pInfo
=
(
SFilter
OperatorInfo
*
)
param
;
doDestroyFilterInfo
(
pInfo
->
pFilterInfo
,
pInfo
->
numOfFilterCols
);
doDestroyFilterInfo
(
pInfo
->
pFilterInfo
,
pInfo
->
numOfFilterCols
);
}
}
...
@@ -5394,9 +5394,9 @@ SOperatorInfo* createArithOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorI
...
@@ -5394,9 +5394,9 @@ SOperatorInfo* createArithOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorI
return
pOperator
;
return
pOperator
;
}
}
SOperatorInfo
*
create
Condition
OperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
SOperatorInfo
*
create
Filter
OperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
)
{
int32_t
numOfOutput
)
{
S
ConditionOperatorInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SCondition
OperatorInfo
));
S
FilterOperatorInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SFilter
OperatorInfo
));
{
{
SColumnInfo
*
pCols
=
calloc
(
numOfOutput
,
sizeof
(
SColumnInfo
));
SColumnInfo
*
pCols
=
calloc
(
numOfOutput
,
sizeof
(
SColumnInfo
));
...
@@ -5430,7 +5430,7 @@ SOperatorInfo* createConditionOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOpera
...
@@ -5430,7 +5430,7 @@ SOperatorInfo* createConditionOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOpera
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
pOperator
->
name
=
"ConditionOperator"
;
pOperator
->
name
=
"ConditionOperator"
;
pOperator
->
operatorType
=
OP_
Condition
;
pOperator
->
operatorType
=
OP_
Filter
;
pOperator
->
blockingOptr
=
false
;
pOperator
->
blockingOptr
=
false
;
pOperator
->
status
=
OP_IN_EXECUTING
;
pOperator
->
status
=
OP_IN_EXECUTING
;
pOperator
->
numOfOutput
=
numOfOutput
;
pOperator
->
numOfOutput
=
numOfOutput
;
...
...
src/query/src/qPlan.c
浏览文件 @
a06a1fb3
...
@@ -94,7 +94,7 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
...
@@ -94,7 +94,7 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
if
(
!
pQueryAttr
->
stableQuery
&&
pQueryAttr
->
havingNum
>
0
)
{
if
(
!
pQueryAttr
->
stableQuery
&&
pQueryAttr
->
havingNum
>
0
)
{
op
=
OP_
Condition
;
op
=
OP_
Filter
;
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
}
}
...
@@ -120,7 +120,7 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
...
@@ -120,7 +120,7 @@ SArray* createExecOperatorPlan(SQueryAttr* pQueryAttr) {
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
if
(
!
pQueryAttr
->
stableQuery
&&
pQueryAttr
->
havingNum
>
0
)
{
if
(
!
pQueryAttr
->
stableQuery
&&
pQueryAttr
->
havingNum
>
0
)
{
op
=
OP_
Condition
;
op
=
OP_
Filter
;
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
}
}
...
@@ -157,7 +157,7 @@ SArray* createGlobalMergePlan(SQueryAttr* pQueryAttr) {
...
@@ -157,7 +157,7 @@ SArray* createGlobalMergePlan(SQueryAttr* pQueryAttr) {
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
if
(
pQueryAttr
->
havingNum
>
0
)
{
if
(
pQueryAttr
->
havingNum
>
0
)
{
op
=
OP_
Condition
;
op
=
OP_
Filter
;
taosArrayPush
(
plan
,
&
op
);
taosArrayPush
(
plan
,
&
op
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录