Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
707f0a83
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
707f0a83
编写于
7月 14, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): set correct fill output object.
上级
a911feea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
19 deletion
+22
-19
include/libs/function/functionMgt.h
include/libs/function/functionMgt.h
+0
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-6
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-2
source/libs/function/inc/builtinsimpl.h
source/libs/function/inc/builtinsimpl.h
+1
-2
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+11
-6
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+1
-1
tests/script/tsim/compute/interval.sim
tests/script/tsim/compute/interval.sim
+2
-1
未找到文件。
include/libs/function/functionMgt.h
浏览文件 @
707f0a83
...
@@ -34,7 +34,6 @@ typedef enum EFunctionType {
...
@@ -34,7 +34,6 @@ typedef enum EFunctionType {
FUNCTION_TYPE_ELAPSED
,
FUNCTION_TYPE_ELAPSED
,
FUNCTION_TYPE_IRATE
,
FUNCTION_TYPE_IRATE
,
FUNCTION_TYPE_LAST_ROW
,
FUNCTION_TYPE_LAST_ROW
,
FUNCTION_TYPE_LAST_ROWT
,
// TODO: removed
FUNCTION_TYPE_MAX
,
FUNCTION_TYPE_MAX
,
FUNCTION_TYPE_MIN
,
FUNCTION_TYPE_MIN
,
FUNCTION_TYPE_MODE
,
FUNCTION_TYPE_MODE
,
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
707f0a83
...
@@ -3127,14 +3127,11 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
...
@@ -3127,14 +3127,11 @@ int32_t tsdbGetFileBlocksDistInfo(STsdbReader* pReader, STableBlockDistInfo* pTa
}
}
pTableBlockInfo
->
numOfBlocks
+=
pBlockIter
->
numOfBlocks
;
pTableBlockInfo
->
numOfBlocks
+=
pBlockIter
->
numOfBlocks
;
hasNext
=
(
pBlockIter
->
numOfBlocks
>
0
);
}
}
/*
// tsdbDebug("%p %d blocks found in file for %d table(s), fid:%d, %s", pReader, numOfBlocks, numOfTables,
hasNext = blockIteratorNext(&pStatus->blockIter);
// pReader->pFileGroup->fid, pReader->idStr);
*/
// tsdbDebug("%p %d blocks found in file for %d table(s), fid:%d, %s", pReader, numOfBlocks, numOfTables,
// pReader->pFileGroup->fid, pReader->idStr);
}
}
return
code
;
return
code
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
707f0a83
...
@@ -3409,8 +3409,8 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
...
@@ -3409,8 +3409,8 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
blockDataEnsureCapacity
(
pResBlock
,
pOperator
->
resultInfo
.
capacity
);
blockDataEnsureCapacity
(
pResBlock
,
pOperator
->
resultInfo
.
capacity
);
int32_t
numOfResultRows
=
pOperator
->
resultInfo
.
capacity
-
pBlock
->
info
.
rows
;
int32_t
numOfResultRows
=
pOperator
->
resultInfo
.
capacity
-
p
Res
Block
->
info
.
rows
;
taosFillResultDataBlock
(
pInfo
->
pFillInfo
,
pBlock
,
numOfResultRows
);
taosFillResultDataBlock
(
pInfo
->
pFillInfo
,
p
Res
Block
,
numOfResultRows
);
// current group has no more result to return
// current group has no more result to return
if
(
pResBlock
->
info
.
rows
>
0
)
{
if
(
pResBlock
->
info
.
rows
>
0
)
{
...
@@ -4423,6 +4423,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4423,6 +4423,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
cond
.
twindows
=
(
STimeWindow
){.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
cond
.
twindows
=
(
STimeWindow
){.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
cond
.
suid
=
pBlockNode
->
suid
;
cond
.
suid
=
pBlockNode
->
suid
;
cond
.
type
=
BLOCK_LOAD_OFFSET_ORDER
;
cond
.
type
=
BLOCK_LOAD_OFFSET_ORDER
;
cond
.
startVersion
=
-
1
;
cond
.
endVersion
=
-
1
;
}
}
STsdbReader
*
pReader
=
NULL
;
STsdbReader
*
pReader
=
NULL
;
...
...
source/libs/function/inc/builtinsimpl.h
浏览文件 @
707f0a83
...
@@ -106,7 +106,7 @@ bool irateFuncSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResInfo);
...
@@ -106,7 +106,7 @@ bool irateFuncSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResInfo);
int32_t
irateFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
irateFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
irateFinalize
(
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
);
int32_t
irateFinalize
(
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
);
int32_t
lastr
owFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
cacheLastR
owFunction
(
SqlFunctionCtx
*
pCtx
);
bool
getFirstLastFuncEnv
(
struct
SFunctionNode
*
pFunc
,
SFuncExecEnv
*
pEnv
);
bool
getFirstLastFuncEnv
(
struct
SFunctionNode
*
pFunc
,
SFuncExecEnv
*
pEnv
);
int32_t
firstFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
firstFunction
(
SqlFunctionCtx
*
pCtx
);
...
@@ -120,7 +120,6 @@ int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx);
...
@@ -120,7 +120,6 @@ int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx);
int32_t
getFirstLastInfoSize
(
int32_t
resBytes
);
int32_t
getFirstLastInfoSize
(
int32_t
resBytes
);
int32_t
lastRowFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
lastRowFunction
(
SqlFunctionCtx
*
pCtx
);
int32_t
lastRowFinalize
(
SqlFunctionCtx
*
pCtx
,
SSDataBlock
*
pBlock
);
bool
getTopBotFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
);
bool
getTopBotFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
);
bool
getTopBotMergeFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
);
bool
getTopBotMergeFuncEnv
(
SFunctionNode
*
UNUSED_PARAM
(
pFunc
),
SFuncExecEnv
*
pEnv
);
...
...
source/libs/function/src/builtins.c
浏览文件 @
707f0a83
...
@@ -1370,11 +1370,6 @@ static int32_t translateTail(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
...
@@ -1370,11 +1370,6 @@ static int32_t translateTail(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
translateLastRow
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
// todo
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateDerivative
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
static
int32_t
translateDerivative
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
if
(
3
!=
LIST_LENGTH
(
pFunc
->
pParameterList
))
{
if
(
3
!=
LIST_LENGTH
(
pFunc
->
pParameterList
))
{
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
...
@@ -2221,7 +2216,17 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
...
@@ -2221,7 +2216,17 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
translateFunc
=
translateFirstLast
,
.
translateFunc
=
translateFirstLast
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
initFunc
=
functionSetup
,
.
initFunc
=
functionSetup
,
.
processFunc
=
lastrowFunction
,
.
processFunc
=
lastRowFunction
,
.
finalizeFunc
=
firstLastFinalize
},
{
.
name
=
"_cache_last_row"
,
.
type
=
FUNCTION_TYPE_CACHE_LAST_ROW
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_MULTI_RES_FUNC
|
FUNC_MGT_TIMELINE_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
,
.
translateFunc
=
translateFirstLast
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
initFunc
=
functionSetup
,
.
processFunc
=
cacheLastRowFunction
,
.
finalizeFunc
=
firstLastFinalize
.
finalizeFunc
=
firstLastFinalize
},
},
{
{
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
707f0a83
...
@@ -5993,7 +5993,7 @@ int32_t interpFunction(SqlFunctionCtx* pCtx) {
...
@@ -5993,7 +5993,7 @@ int32_t interpFunction(SqlFunctionCtx* pCtx) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
lastr
owFunction
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
cacheLastR
owFunction
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
numOfElems
=
0
;
int32_t
numOfElems
=
0
;
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
...
...
tests/script/tsim/compute/interval.sim
浏览文件 @
707f0a83
...
@@ -103,7 +103,8 @@ $ms2 = 1601481600000 - $cc
...
@@ -103,7 +103,8 @@ $ms2 = 1601481600000 - $cc
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts <= $ms and ts > $ms2 interval(1m) fill(value,0)
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts <= $ms and ts > $ms2 interval(1m) fill(value,0)
print ===> $rows
print ===> $rows
if $rows < 30 then
if $rows < 30 then
print expect greater than 30, actual: $rows
return -1
return -1
endi
endi
if $rows > 50 then
if $rows > 50 then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录