Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e8ff71f7
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
e8ff71f7
编写于
2月 24, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-2895] refactor.
上级
9d4b925d
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
262 addition
and
239 deletion
+262
-239
src/client/src/tscServer.c
src/client/src/tscServer.c
+25
-2
src/inc/taosmsg.h
src/inc/taosmsg.h
+4
-1
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+14
-24
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+0
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+214
-202
src/query/src/qFill.c
src/query/src/qFill.c
+5
-5
tests/script/general/parser/fill.sim
tests/script/general/parser/fill.sim
+0
-4
未找到文件。
src/client/src/tscServer.c
浏览文件 @
e8ff71f7
...
...
@@ -825,13 +825,31 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pSqlFuncExpr
->
colInfo
.
colIndex
=
htons
(
pExpr
->
colInfo
.
colIndex
);
pSqlFuncExpr
->
colInfo
.
flag
=
htons
(
pExpr
->
colInfo
.
flag
);
if
(
TSDB_COL_IS_UD_COL
(
pExpr
->
colInfo
.
flag
))
{
pSqlFuncExpr
->
colType
=
htons
(
pExpr
->
resType
);
pSqlFuncExpr
->
colBytes
=
htons
(
pExpr
->
resBytes
);
}
else
if
(
pExpr
->
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
SSchema
*
s
=
tGetTbnameColumnSchema
();
pSqlFuncExpr
->
colType
=
htons
(
s
->
type
);
pSqlFuncExpr
->
colBytes
=
htons
(
s
->
bytes
);
}
else
if
(
pExpr
->
colInfo
.
colId
==
TSDB_BLOCK_DIST_COLUMN_INDEX
)
{
SSchema
s
=
tGetBlockDistColumnSchema
();
pSqlFuncExpr
->
colType
=
htons
(
s
.
type
);
pSqlFuncExpr
->
colBytes
=
htons
(
s
.
bytes
);
}
else
{
SSchema
*
s
=
tscGetColumnSchemaById
(
pTableMeta
,
pExpr
->
colInfo
.
colId
);
pSqlFuncExpr
->
colType
=
htons
(
s
->
type
);
pSqlFuncExpr
->
colBytes
=
htons
(
s
->
bytes
);
}
pSqlFuncExpr
->
functionId
=
htons
(
pExpr
->
functionId
);
pSqlFuncExpr
->
numOfParams
=
htons
(
pExpr
->
numOfParams
);
pSqlFuncExpr
->
resColId
=
htons
(
pExpr
->
resColId
);
pMsg
+=
sizeof
(
SSqlFuncMsg
);
for
(
int32_t
j
=
0
;
j
<
pExpr
->
numOfParams
;
++
j
)
{
// todo add log
for
(
int32_t
j
=
0
;
j
<
pExpr
->
numOfParams
;
++
j
)
{
// todo add log
pSqlFuncExpr
->
arg
[
j
].
argType
=
htons
((
uint16_t
)
pExpr
->
param
[
j
].
nType
);
pSqlFuncExpr
->
arg
[
j
].
argBytes
=
htons
(
pExpr
->
param
[
j
].
nLen
);
...
...
@@ -869,14 +887,19 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pSqlFuncExpr1
->
colInfo
.
colId
=
htons
(
pExpr
->
resColId
);
pSqlFuncExpr1
->
colInfo
.
flag
=
htons
(
TSDB_COL_NORMAL
);
bool
assign
=
false
;
for
(
int32_t
f
=
0
;
f
<
tscSqlExprNumOfExprs
(
pQueryInfo
);
++
f
)
{
SSqlExpr
*
pe
=
tscSqlExprGet
(
pQueryInfo
,
f
);
if
(
pe
==
pExpr
)
{
pSqlFuncExpr1
->
colInfo
.
colIndex
=
htons
(
f
);
pSqlFuncExpr1
->
colType
=
htons
(
pe
->
resType
);
pSqlFuncExpr1
->
colBytes
=
htons
(
pe
->
resBytes
);
assign
=
true
;
break
;
}
}
assert
(
assign
);
pMsg
+=
sizeof
(
SSqlFuncMsg
);
pSqlFuncExpr1
=
(
SSqlFuncMsg
*
)
pMsg
;
}
else
{
...
...
src/inc/taosmsg.h
浏览文件 @
e8ff71f7
...
...
@@ -387,7 +387,7 @@ typedef struct SColIndex {
int16_t
colId
;
// column id
int16_t
colIndex
;
// column index in colList if it is a normal column or index in tagColList if a tag
uint16_t
flag
;
// denote if it is a tag or a normal column
char
name
[
TSDB_COL_NAME_LEN
];
char
name
[
TSDB_COL_NAME_LEN
];
// TODO remove it
}
SColIndex
;
/* sql function msg, to describe the message to vnode about sql function
...
...
@@ -395,7 +395,10 @@ typedef struct SColIndex {
typedef
struct
SSqlFuncMsg
{
int16_t
functionId
;
int16_t
numOfParams
;
int16_t
resColId
;
// result column id, id of the current output column
int16_t
colType
;
int16_t
colBytes
;
SColIndex
colInfo
;
struct
ArgElem
{
...
...
src/query/inc/qExecutor.h
浏览文件 @
e8ff71f7
...
...
@@ -240,6 +240,7 @@ typedef struct SQuery {
}
SQuery
;
typedef
SSDataBlock
*
(
*
__operator_fn_t
)(
void
*
param
);
typedef
void
(
*
__optr_cleanup_fn_t
)(
void
*
param
,
int32_t
num
);
struct
SOperatorInfo
;
...
...
@@ -256,8 +257,6 @@ typedef struct SQueryRuntimeEnv {
SHashObj
*
pResultRowHashTable
;
// quick locate the window object for each result
char
*
keyBuf
;
// window key buffer
SResultRowPool
*
pool
;
// window result object pool
// int32_t* rowCellInfoOffset;// offset value for each row result cell info
char
**
prevRow
;
SArray
*
prevResult
;
// intermediate result, SArray<SInterResult>
...
...
@@ -285,11 +284,11 @@ typedef struct SOperatorInfo {
SExprInfo
*
pExpr
;
int32_t
numOfOutput
;
SQueryRuntimeEnv
*
pRuntimeEnv
;
SQueryRuntimeEnv
*
pRuntimeEnv
;
struct
SOperatorInfo
*
upstream
;
__operator_fn_t
exec
;
__operator_fn_t
cleanup
;
struct
SOperatorInfo
*
upstream
;
__optr_cleanup_fn_t
cleanup
;
}
SOperatorInfo
;
enum
{
...
...
@@ -357,6 +356,7 @@ typedef struct STableScanInfo {
SQLFunctionCtx
*
pCtx
;
// next operator query context
SResultRowInfo
*
pResultRowInfo
;
int32_t
numOfOutput
;
int32_t
*
rowCellInfoOffset
;
int64_t
elapsedTime
;
...
...
@@ -367,19 +367,19 @@ typedef struct STagScanInfo {
SSDataBlock
*
pRes
;
}
STagScanInfo
;
typedef
struct
S
AggOperator
Info
{
typedef
struct
S
OptrBasic
Info
{
SResultRowInfo
resultRowInfo
;
int32_t
*
rowCellInfoOffset
;
// offset value for each row result cell info
SQLFunctionCtx
*
pCtx
;
int32_t
*
rowCellInfoOffset
;
SSDataBlock
*
pRes
;
}
SAggOperatorInfo
;
}
SOptrBasicInfo
;
typedef
struct
SOptrBasicInfo
SAggOperatorInfo
;
typedef
struct
SOptrBasicInfo
SHashIntervalOperatorInfo
;
typedef
struct
SArithOperatorInfo
{
SQLFunctionCtx
*
pCtx
;
int32_t
*
rowCellInfoOffset
;
SResultRowInfo
resultRowInfo
;
SSDataBlock
*
pOutput
;
int32_t
bufCapacity
;
SOptrBasicInfo
binfo
;
int32_t
bufCapacity
;
}
SArithOperatorInfo
;
typedef
struct
SLimitOperatorInfo
{
...
...
@@ -392,22 +392,12 @@ typedef struct SOffsetOperatorInfo {
int64_t
currentOffset
;
}
SOffsetOperatorInfo
;
typedef
struct
SHashIntervalOperatorInfo
{
SQLFunctionCtx
*
pCtx
;
int32_t
*
rowCellInfoOffset
;
SResultRowInfo
resultRowInfo
;
SSDataBlock
*
pRes
;
}
SHashIntervalOperatorInfo
;
typedef
struct
SFillOperatorInfo
{
SSDataBlock
*
pRes
;
}
SFillOperatorInfo
;
typedef
struct
SHashGroupbyOperatorInfo
{
SQLFunctionCtx
*
pCtx
;
int32_t
*
rowCellInfoOffset
;
SResultRowInfo
resultRowInfo
;
SSDataBlock
*
pRes
;
SOptrBasicInfo
binfo
;
int32_t
colIndex
;
}
SHashGroupbyOperatorInfo
;
...
...
src/query/src/qAggMain.c
浏览文件 @
e8ff71f7
...
...
@@ -3566,7 +3566,6 @@ static void arithmetic_function(SQLFunctionCtx *pCtx) {
SArithmeticSupport
*
sas
=
(
SArithmeticSupport
*
)
pCtx
->
param
[
1
].
pz
;
arithmeticTreeTraverse
(
sas
->
pArithExpr
->
pExpr
,
pCtx
->
size
,
pCtx
->
pOutput
,
sas
,
pCtx
->
order
,
getArithColumnData
);
// pCtx->pOutput += pCtx->outputBytes * pCtx->size;
}
static
void
arithmetic_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
...
...
src/query/src/qExecutor.c
浏览文件 @
e8ff71f7
此差异已折叠。
点击以展开。
src/query/src/qFill.c
浏览文件 @
e8ff71f7
...
...
@@ -279,7 +279,7 @@ static int32_t setTagColumnInfo(SFillInfo* pFillInfo, int32_t numOfCols, int32_t
int32_t
k
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SFillColInfo
*
pColInfo
=
&
pFillInfo
->
pFillCol
[
i
];
pFillInfo
->
pData
[
i
]
=
calloc
(
1
,
pColInfo
->
col
.
bytes
*
capacity
)
;
pFillInfo
->
pData
[
i
]
=
NULL
;
if
(
TSDB_COL_IS_TAG
(
pColInfo
->
flag
))
{
bool
exists
=
false
;
...
...
@@ -377,10 +377,10 @@ void* taosDestroyFillInfo(SFillInfo* pFillInfo) {
tfree
(
pFillInfo
->
prevValues
);
tfree
(
pFillInfo
->
nextValues
);
tfree
(
pFillInfo
->
pTags
);
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
tfree
(
pFillInfo
->
pData
[
i
]);
}
//
for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
//
tfree(pFillInfo->pData[i]);
//
}
tfree
(
pFillInfo
->
pData
);
tfree
(
pFillInfo
->
pFillCol
);
...
...
tests/script/general/parser/fill.sim
浏览文件 @
e8ff71f7
...
...
@@ -980,10 +980,6 @@ if $data00 != @20-01-01 01:01:00.000@ then
return -1
endi
if $data00 != @20-01-01 01:01:00.000@ then
return -1
endi
if $data1
if $data01 != 2.000000000 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录