Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
c454def8
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c454def8
编写于
6月 01, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] update the intermediate result size
上级
87c5f7ca
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
28 addition
and
32 deletion
+28
-32
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+22
-26
src/client/src/tscSecondaryMerge.c
src/client/src/tscSecondaryMerge.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/query/inc/tsqlfunction.h
src/query/inc/tsqlfunction.h
+1
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
c454def8
...
...
@@ -84,7 +84,7 @@ typedef struct SSqlExpr {
int16_t
functionId
;
// function id in aAgg array
int16_t
resType
;
// return value type
int16_t
resBytes
;
// length of return value
int
16
_t
interBytes
;
// inter result buffer size
int
32
_t
interBytes
;
// inter result buffer size
int16_t
numOfParams
;
// argument value of each function
tVariant
param
[
3
];
// parameters are not more than 3
int32_t
offset
;
// sub result column value of arithmetic expression.
...
...
src/client/src/tscFunctionImpl.c
浏览文件 @
c454def8
...
...
@@ -153,7 +153,7 @@ typedef struct SRateInfo {
int32_t
getResultDataInfo
(
int32_t
dataType
,
int32_t
dataBytes
,
int32_t
functionId
,
int32_t
param
,
int16_t
*
type
,
int16_t
*
bytes
,
int
16
_t
*
interBytes
,
int16_t
extLength
,
bool
isSuperTable
)
{
int16_t
*
bytes
,
int
32
_t
*
interBytes
,
int16_t
extLength
,
bool
isSuperTable
)
{
if
(
!
isValidDataType
(
dataType
,
dataBytes
))
{
tscError
(
"Illegal data type %d or data type length %d"
,
dataType
,
dataBytes
);
return
TSDB_CODE_INVALID_SQL
;
...
...
src/client/src/tscSQLParser.c
浏览文件 @
c454def8
...
...
@@ -1594,7 +1594,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
int16_t
resultType
=
0
;
int16_t
resultSize
=
0
;
int
16
_t
intermediateResSize
=
0
;
int
32
_t
intermediateResSize
=
0
;
int16_t
functionID
=
0
;
if
(
changeFunctionID
(
optr
,
&
functionID
)
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -1901,7 +1901,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
int16_t
bytes
=
0
;
int16_t
type
=
0
;
int
16
_t
inter
=
0
;
int
32
_t
inter
=
0
;
int32_t
ret
=
getResultDataInfo
(
s
.
type
,
s
.
bytes
,
TSDB_FUNC_TID_TAG
,
0
,
&
type
,
&
bytes
,
&
inter
,
0
,
0
);
assert
(
ret
==
TSDB_CODE_SUCCESS
);
...
...
@@ -2287,7 +2287,7 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
int16_t
bytes
=
0
;
int16_t
type
=
0
;
int
16_t
intermediate
Bytes
=
0
;
int
32_t
inter
Bytes
=
0
;
size_t
size
=
tscSqlExprNumOfExprs
(
pQueryInfo
);
for
(
int32_t
k
=
0
;
k
<
size
;
++
k
)
{
...
...
@@ -2301,13 +2301,13 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
(
functionId
>=
TSDB_FUNC_FIRST_DST
&&
functionId
<=
TSDB_FUNC_LAST_DST
)
||
(
functionId
>=
TSDB_FUNC_RATE
&&
functionId
<=
TSDB_FUNC_AVG_IRATE
))
{
if
(
getResultDataInfo
(
pSrcSchema
->
type
,
pSrcSchema
->
bytes
,
functionId
,
pExpr
->
param
[
0
].
i64Key
,
&
type
,
&
bytes
,
&
inter
mediate
Bytes
,
0
,
true
)
!=
TSDB_CODE_SUCCESS
)
{
&
interBytes
,
0
,
true
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_INVALID_SQL
;
}
tscSqlExprUpdate
(
pQueryInfo
,
k
,
functionId
,
pExpr
->
colInfo
.
colIndex
,
TSDB_DATA_TYPE_BINARY
,
bytes
);
// todo refactor
pExpr
->
interBytes
=
inter
mediate
Bytes
;
pExpr
->
interBytes
=
interBytes
;
}
}
...
...
@@ -2327,27 +2327,23 @@ void tscRestoreSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
i
);
SSchema
*
pSchema
=
tscGetTableColumnSchema
(
pTableMetaInfo
->
pTableMeta
,
pExpr
->
colInfo
.
colIndex
);
// if (/*(pExpr->functionId >= TSDB_FUNC_FIRST_DST && pExpr->functionId <= TSDB_FUNC_LAST_DST) ||
// (pExpr->functionId >= TSDB_FUNC_SUM && pExpr->functionId <= TSDB_FUNC_MAX) ||
// pExpr->functionId == TSDB_FUNC_LAST_ROW*/) {
// the final result size and type in the same as query on single table.
// so here, set the flag to be false;
int16_t
inter
=
0
;
int32_t
functionId
=
pExpr
->
functionId
;
if
(
functionId
>=
TSDB_FUNC_TS
&&
functionId
<=
TSDB_FUNC_DIFF
)
{
continue
;
}
if
(
functionId
==
TSDB_FUNC_FIRST_DST
)
{
functionId
=
TSDB_FUNC_FIRST
;
}
else
if
(
functionId
==
TSDB_FUNC_LAST_DST
)
{
functionId
=
TSDB_FUNC_LAST
;
}
getResultDataInfo
(
pSchema
->
type
,
pSchema
->
bytes
,
functionId
,
0
,
&
pExpr
->
resType
,
&
pExpr
->
resBytes
,
&
inter
,
0
,
false
);
// }
// the final result size and type in the same as query on single table.
// so here, set the flag to be false;
int32_t
inter
=
0
;
int32_t
functionId
=
pExpr
->
functionId
;
if
(
functionId
>=
TSDB_FUNC_TS
&&
functionId
<=
TSDB_FUNC_DIFF
)
{
continue
;
}
if
(
functionId
==
TSDB_FUNC_FIRST_DST
)
{
functionId
=
TSDB_FUNC_FIRST
;
}
else
if
(
functionId
==
TSDB_FUNC_LAST_DST
)
{
functionId
=
TSDB_FUNC_LAST
;
}
getResultDataInfo
(
pSchema
->
type
,
pSchema
->
bytes
,
functionId
,
0
,
&
pExpr
->
resType
,
&
pExpr
->
resBytes
,
&
inter
,
0
,
false
);
}
}
...
...
src/client/src/tscSecondaryMerge.c
浏览文件 @
c454def8
...
...
@@ -689,7 +689,7 @@ int32_t tscLocalReducerEnvCreate(SSqlObj *pSql, tExtMemBuffer ***pMemBuffer, tOr
SSchema
*
p1
=
tscGetTableColumnSchema
(
pTableMetaInfo
->
pTableMeta
,
pExpr
->
colInfo
.
colIndex
);
int
16
_t
inter
=
0
;
int
32
_t
inter
=
0
;
int16_t
type
=
-
1
;
int16_t
bytes
=
0
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
c454def8
...
...
@@ -1084,7 +1084,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
int16_t
bytes
=
0
;
int16_t
type
=
0
;
int
16
_t
inter
=
0
;
int
32
_t
inter
=
0
;
getResultDataInfo
(
s
.
type
,
s
.
bytes
,
TSDB_FUNC_TID_TAG
,
0
,
&
type
,
&
bytes
,
&
inter
,
0
,
0
);
...
...
src/inc/taosmsg.h
浏览文件 @
c454def8
...
...
@@ -370,7 +370,7 @@ typedef struct SExprInfo {
struct
tExprNode
*
pExpr
;
int16_t
bytes
;
int16_t
type
;
int
16
_t
interBytes
;
int
32
_t
interBytes
;
}
SExprInfo
;
typedef
struct
SColumnFilterInfo
{
...
...
src/query/inc/tsqlfunction.h
浏览文件 @
c454def8
...
...
@@ -217,7 +217,7 @@ typedef struct SQLAggFuncElem {
#define GET_RES_INFO(ctx) ((ctx)->resultInfo)
int32_t
getResultDataInfo
(
int32_t
dataType
,
int32_t
dataBytes
,
int32_t
functionId
,
int32_t
param
,
int16_t
*
type
,
int16_t
*
len
,
int
16
_t
*
interBytes
,
int16_t
extLength
,
bool
isSuperTable
);
int16_t
*
len
,
int
32
_t
*
interBytes
,
int16_t
extLength
,
bool
isSuperTable
);
#define IS_STREAM_QUERY_VALID(x) (((x)&TSDB_FUNCSTATE_STREAM) != 0)
#define IS_MULTIOUTPUT(x) (((x)&TSDB_FUNCSTATE_MO) != 0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录