Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
13229b0e
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看板
提交
13229b0e
编写于
6月 08, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into enh/tsdb_optimize
上级
9d4a626f
d7f9857a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
262 addition
and
76 deletion
+262
-76
include/common/tdatablock.h
include/common/tdatablock.h
+1
-0
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+1
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+18
-6
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+2
-4
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+5
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+10
-2
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+42
-15
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+4
-0
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+179
-47
未找到文件。
include/common/tdatablock.h
浏览文件 @
13229b0e
...
...
@@ -248,6 +248,7 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** pReq, const SSDataBlock* pData
tb_uid_t
suid
);
char
*
buildCtbNameByGroupId
(
const
char
*
stbName
,
uint64_t
groupId
);
int32_t
buildCtbNameByGroupIdImpl
(
const
char
*
stbName
,
uint64_t
groupId
,
char
*
pBuf
);
static
FORCE_INLINE
int32_t
blockGetEncodeSize
(
const
SSDataBlock
*
pBlock
)
{
return
blockDataGetSerialMetaSize
(
taosArrayGetSize
(
pBlock
->
pDataBlock
))
+
blockDataGetSize
(
pBlock
);
...
...
include/libs/stream/tstream.h
浏览文件 @
13229b0e
...
...
@@ -327,6 +327,7 @@ struct SStreamTask {
int64_t
checkpointingId
;
int32_t
checkpointAlignCnt
;
struct
SStreamMeta
*
pMeta
;
SSHashObj
*
pNameMap
;
};
// meta
...
...
source/common/src/tdatablock.c
浏览文件 @
13229b0e
...
...
@@ -2465,19 +2465,31 @@ _end:
}
char
*
buildCtbNameByGroupId
(
const
char
*
stbFullName
,
uint64_t
groupId
)
{
if
(
stbFullName
[
0
]
==
0
)
{
char
*
pBuf
=
taosMemoryCalloc
(
1
,
TSDB_TABLE_NAME_LEN
+
1
);
if
(
!
pBuf
)
{
return
NULL
;
}
int32_t
code
=
buildCtbNameByGroupIdImpl
(
stbFullName
,
groupId
,
pBuf
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFree
(
pBuf
);
return
NULL
;
}
return
pBuf
;
}
int32_t
buildCtbNameByGroupIdImpl
(
const
char
*
stbFullName
,
uint64_t
groupId
,
char
*
cname
)
{
if
(
stbFullName
[
0
]
==
0
)
{
return
TSDB_CODE_FAILED
;
}
SArray
*
tags
=
taosArrayInit
(
0
,
sizeof
(
SSmlKv
));
if
(
tags
==
NULL
)
{
return
NULL
;
return
TSDB_CODE_FAILED
;
}
void
*
cname
=
taosMemoryCalloc
(
1
,
TSDB_TABLE_NAME_LEN
+
1
);
if
(
cname
==
NULL
)
{
taosArrayDestroy
(
tags
);
return
NULL
;
return
TSDB_CODE_FAILED
;
}
SSmlKv
pTag
=
{.
key
=
"group_id"
,
...
...
@@ -2499,9 +2511,9 @@ char* buildCtbNameByGroupId(const char* stbFullName, uint64_t groupId) {
taosArrayDestroy
(
tags
);
if
((
rname
.
ctbShortName
&&
rname
.
ctbShortName
[
0
])
==
0
)
{
return
NULL
;
return
TSDB_CODE_FAILED
;
}
return
rname
.
ctbShortName
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
blockEncode
(
const
SSDataBlock
*
pBlock
,
char
*
data
,
int32_t
numOfCols
)
{
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
13229b0e
...
...
@@ -298,10 +298,8 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
if
(
res
==
TSDB_CODE_SUCCESS
)
{
memcpy
(
ctbName
,
pTableSinkInfo
->
tbName
,
strlen
(
pTableSinkInfo
->
tbName
));
}
else
{
char
*
tmp
=
buildCtbNameByGroupId
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
);
memcpy
(
ctbName
,
tmp
,
strlen
(
tmp
));
memcpy
(
pTableSinkInfo
->
tbName
,
tmp
,
strlen
(
tmp
));
taosMemoryFree
(
tmp
);
buildCtbNameByGroupIdImpl
(
stbFullName
,
pDataBlock
->
info
.
id
.
groupId
,
ctbName
);
memcpy
(
pTableSinkInfo
->
tbName
,
ctbName
,
strlen
(
ctbName
));
tqDebug
(
"vgId:%d, gropuId:%"
PRIu64
" datablock table name is null"
,
TD_VID
(
pVnode
),
pDataBlock
->
info
.
id
.
groupId
);
}
...
...
source/libs/executor/src/timesliceoperator.c
浏览文件 @
13229b0e
...
...
@@ -257,7 +257,8 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
// output the result
bool
hasInterp
=
true
;
int32_t
fillColIndex
=
0
;
bool
hasInterp
=
true
;
for
(
int32_t
j
=
0
;
j
<
pExprSup
->
numOfExprs
;
++
j
)
{
SExprInfo
*
pExprInfo
=
&
pExprSup
->
pExprInfo
[
j
];
...
...
@@ -307,7 +308,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
case
TSDB_FILL_SET_VALUE
:
case
TSDB_FILL_SET_VALUE_F
:
{
SVariant
*
pVar
=
&
pSliceInfo
->
pFillColInfo
[
j
].
fillVal
;
SVariant
*
pVar
=
&
pSliceInfo
->
pFillColInfo
[
fillColIndex
].
fillVal
;
if
(
pDst
->
info
.
type
==
TSDB_DATA_TYPE_FLOAT
)
{
float
v
=
0
;
...
...
@@ -342,6 +343,8 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
}
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
++
fillColIndex
;
break
;
}
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
13229b0e
...
...
@@ -707,6 +707,10 @@ static bool isWindowPseudoColumnFunc(const SNode* pNode) {
return
(
QUERY_NODE_FUNCTION
==
nodeType
(
pNode
)
&&
fmIsWindowPseudoColumnFunc
(((
SFunctionNode
*
)
pNode
)
->
funcId
));
}
static
bool
isInterpFunc
(
const
SNode
*
pNode
)
{
return
(
QUERY_NODE_FUNCTION
==
nodeType
(
pNode
)
&&
fmIsInterpFunc
(((
SFunctionNode
*
)
pNode
)
->
funcId
));
}
static
bool
isInterpPseudoColumnFunc
(
const
SNode
*
pNode
)
{
return
(
QUERY_NODE_FUNCTION
==
nodeType
(
pNode
)
&&
fmIsInterpPseudoColumnFunc
(((
SFunctionNode
*
)
pNode
)
->
funcId
));
}
...
...
@@ -3030,7 +3034,7 @@ static int32_t translateOrderBy(STranslateContext* pCxt, SSelectStmt* pSelect) {
}
static
EDealRes
needFillImpl
(
SNode
*
pNode
,
void
*
pContext
)
{
if
(
isAggFunc
(
pNode
)
&&
FUNCTION_TYPE_GROUP_KEY
!=
((
SFunctionNode
*
)
pNode
)
->
funcType
)
{
if
(
(
isAggFunc
(
pNode
)
||
isInterpFunc
(
pNode
)
)
&&
FUNCTION_TYPE_GROUP_KEY
!=
((
SFunctionNode
*
)
pNode
)
->
funcType
)
{
*
(
bool
*
)
pContext
=
true
;
return
DEAL_RES_END
;
}
...
...
@@ -3054,7 +3058,7 @@ static int32_t convertFillValue(STranslateContext* pCxt, SDataType dt, SNodeList
code
=
scalarCalculateConstants
(
pCaseFunc
,
&
pCell
->
pNode
);
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
QUERY_NODE_VALUE
!=
nodeType
(
pCell
->
pNode
))
{
code
=
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WRONG_VALUE_TYPE
,
"Fill value
is just a
constant"
);
code
=
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WRONG_VALUE_TYPE
,
"Fill value
can only accept
constant"
);
}
else
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
code
=
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_WRONG_VALUE_TYPE
,
"Filled data type mismatch"
);
}
...
...
@@ -3078,6 +3082,7 @@ static int32_t checkFillValues(STranslateContext* pCxt, SFillNode* pFill, SNodeL
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
return
code
;
}
++
fillNo
;
}
}
...
...
@@ -3562,6 +3567,9 @@ static int32_t translateInterpFill(STranslateContext* pCxt, SSelectStmt* pSelect
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkFill
(
pCxt
,
(
SFillNode
*
)
pSelect
->
pFill
,
(
SValueNode
*
)
pSelect
->
pEvery
,
true
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkFillValues
(
pCxt
,
(
SFillNode
*
)
pSelect
->
pFill
,
pSelect
->
pProjectionList
);
}
return
code
;
}
...
...
source/libs/stream/src/streamDispatch.c
浏览文件 @
13229b0e
...
...
@@ -15,6 +15,13 @@
#include "streamInc.h"
#define MAX_BLOCK_NAME_NUM 1024
typedef
struct
SBlockName
{
uint32_t
hashValue
;
char
parTbName
[
TSDB_TABLE_NAME_LEN
];
}
SBlockName
;
int32_t
tEncodeStreamDispatchReq
(
SEncoder
*
pEncoder
,
const
SStreamDispatchReq
*
pReq
)
{
if
(
tStartEncode
(
pEncoder
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pReq
->
streamId
)
<
0
)
return
-
1
;
...
...
@@ -331,26 +338,46 @@ FAIL:
int32_t
streamSearchAndAddBlock
(
SStreamTask
*
pTask
,
SStreamDispatchReq
*
pReqs
,
SSDataBlock
*
pDataBlock
,
int32_t
vgSz
,
int64_t
groupId
)
{
char
*
ctbName
=
taosMemoryCalloc
(
1
,
TSDB_TABLE_FNAME_LEN
);
if
(
ctbName
==
NULL
)
{
return
-
1
;
uint32_t
hashValue
=
0
;
SArray
*
vgInfo
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
if
(
pTask
->
pNameMap
==
NULL
)
{
pTask
->
pNameMap
=
tSimpleHashInit
(
1024
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
));
}
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
snprintf
(
ctbName
,
TSDB_TABLE_NAME_LEN
,
"%s.%s"
,
pTask
->
shuffleDispatcher
.
dbInfo
.
db
,
pDataBlock
->
info
.
parTbName
);
void
*
pVal
=
tSimpleHashGet
(
pTask
->
pNameMap
,
&
groupId
,
sizeof
(
int64_t
));
if
(
pVal
)
{
SBlockName
*
pBln
=
(
SBlockName
*
)
pVal
;
hashValue
=
pBln
->
hashValue
;
if
(
!
pDataBlock
->
info
.
parTbName
[
0
])
{
memcpy
(
pDataBlock
->
info
.
parTbName
,
pBln
->
parTbName
,
strlen
(
pBln
->
parTbName
));
}
}
else
{
char
*
ctb
ShortName
=
buildCtbNameByGroupId
(
pTask
->
shuffleDispatcher
.
stbFullName
,
groupId
);
snprintf
(
ctbName
,
TSDB_TABLE_NAME_LEN
,
"%s.%s"
,
pTask
->
shuffleDispatcher
.
dbInfo
.
db
,
ctbShortName
);
taosMemoryFree
(
ctbShortName
)
;
}
char
*
ctb
Name
=
taosMemoryCalloc
(
1
,
TSDB_TABLE_FNAME_LEN
);
if
(
ctbName
==
NULL
)
{
return
-
1
;
}
SArray
*
vgInfo
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
if
(
pDataBlock
->
info
.
parTbName
[
0
])
{
snprintf
(
ctbName
,
TSDB_TABLE_NAME_LEN
,
"%s.%s"
,
pTask
->
shuffleDispatcher
.
dbInfo
.
db
,
pDataBlock
->
info
.
parTbName
);
}
else
{
buildCtbNameByGroupIdImpl
(
pTask
->
shuffleDispatcher
.
stbFullName
,
groupId
,
pDataBlock
->
info
.
parTbName
);
snprintf
(
ctbName
,
TSDB_TABLE_NAME_LEN
,
"%s.%s"
,
pTask
->
shuffleDispatcher
.
dbInfo
.
db
,
pDataBlock
->
info
.
parTbName
);
}
/*uint32_t hashValue = MurmurHash3_32(ctbName, strlen(ctbName));*/
SUseDbRsp
*
pDbInfo
=
&
pTask
->
shuffleDispatcher
.
dbInfo
;
uint32_t
hashValue
=
taosGetTbHashVal
(
ctbName
,
strlen
(
ctbName
),
pDbInfo
->
hashMethod
,
pDbInfo
->
hashPrefix
,
pDbInfo
->
hashSuffix
);
taosMemoryFree
(
ctbName
);
SArray
*
vgInfo
=
pTask
->
shuffleDispatcher
.
dbInfo
.
pVgroupInfos
;
/*uint32_t hashValue = MurmurHash3_32(ctbName, strlen(ctbName));*/
SUseDbRsp
*
pDbInfo
=
&
pTask
->
shuffleDispatcher
.
dbInfo
;
hashValue
=
taosGetTbHashVal
(
ctbName
,
strlen
(
ctbName
),
pDbInfo
->
hashMethod
,
pDbInfo
->
hashPrefix
,
pDbInfo
->
hashSuffix
);
taosMemoryFree
(
ctbName
);
SBlockName
bln
=
{
0
};
bln
.
hashValue
=
hashValue
;
memcpy
(
bln
.
parTbName
,
pDataBlock
->
info
.
parTbName
,
strlen
(
pDataBlock
->
info
.
parTbName
));
if
(
tSimpleHashGetSize
(
pTask
->
pNameMap
)
<
MAX_BLOCK_NAME_NUM
)
{
tSimpleHashPut
(
pTask
->
pNameMap
,
&
groupId
,
sizeof
(
int64_t
),
&
bln
,
sizeof
(
SBlockName
));
}
}
bool
found
=
false
;
// TODO: optimize search
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
13229b0e
...
...
@@ -224,5 +224,9 @@ void tFreeStreamTask(SStreamTask* pTask) {
taosMemoryFree
((
void
*
)
pTask
->
id
.
idStr
);
}
if
(
pTask
->
pNameMap
)
{
tSimpleHashCleanup
(
pTask
->
pNameMap
);
}
taosMemoryFree
(
pTask
);
}
tests/system-test/2-query/interp.py
浏览文件 @
13229b0e
...
...
@@ -225,6 +225,56 @@ class TDTestCase:
tdSql
.
checkData
(
2
,
0
,
12
)
tdSql
.
checkData
(
3
,
0
,
12
)
## test fill value with scalar expression
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, 1 + 2)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, 1.0 + 2.0)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, 1 + 2.5)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, 1 + '2')"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, 1 + '2.0')"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, '3' + 'abc')"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(value, '2' + '1abc')"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdLog
.
printNoPrefix
(
"==========step5:fill prev"
)
## {. . .}
...
...
@@ -1765,47 +1815,10 @@ class TDTestCase:
tdSql
.
checkData
(
60
,
1
,
60
)
#
# test fill value
tdSql
.
query
(
f
"select
interp(c0),interp(c1) from
{
dbname
}
.
{
tbname1
}
range('2020-02-02 00:00:00', '2020-02-02 00:01:00') every(1s) fill(value, 123
)"
)
tdSql
.
query
(
f
"select
_irowts, interp(c0), _irowts, interp(c1), _irowts from
{
dbname
}
.
{
tbname1
}
range('2020-02-02 00:00:00', '2020-02-02 00:01:00') every(1s) fill(value, 123, 456
)"
)
tdSql
.
checkRows
(
61
)
tdSql
.
checkCols
(
2
)
tdSql
.
checkData
(
0
,
0
,
0
)
#
tdSql
.
checkData
(
1
,
0
,
123
)
tdSql
.
checkData
(
4
,
0
,
123
)
tdSql
.
checkData
(
5
,
0
,
None
)
#
tdSql
.
checkData
(
6
,
0
,
123
)
tdSql
.
checkData
(
9
,
0
,
123
)
tdSql
.
checkData
(
10
,
0
,
10
)
#
tdSql
.
checkData
(
11
,
0
,
123
)
tdSql
.
checkData
(
14
,
0
,
123
)
tdSql
.
checkData
(
15
,
0
,
None
)
#
tdSql
.
checkData
(
16
,
0
,
123
)
tdSql
.
checkData
(
19
,
0
,
123
)
tdSql
.
checkData
(
20
,
0
,
20
)
#
tdSql
.
checkData
(
21
,
0
,
123
)
tdSql
.
checkData
(
24
,
0
,
123
)
tdSql
.
checkData
(
25
,
0
,
None
)
#
tdSql
.
checkData
(
26
,
0
,
123
)
tdSql
.
checkData
(
29
,
0
,
123
)
tdSql
.
checkData
(
30
,
0
,
30
)
#
tdSql
.
checkData
(
31
,
0
,
123
)
tdSql
.
checkData
(
34
,
0
,
123
)
tdSql
.
checkData
(
35
,
0
,
35
)
#
tdSql
.
checkData
(
36
,
0
,
123
)
tdSql
.
checkData
(
39
,
0
,
123
)
tdSql
.
checkData
(
40
,
0
,
40
)
#
tdSql
.
checkData
(
41
,
0
,
123
)
tdSql
.
checkData
(
44
,
0
,
123
)
tdSql
.
checkData
(
45
,
0
,
None
)
#
tdSql
.
checkData
(
46
,
0
,
123
)
tdSql
.
checkData
(
49
,
0
,
123
)
tdSql
.
checkData
(
50
,
0
,
50
)
#
tdSql
.
checkData
(
51
,
0
,
123
)
tdSql
.
checkData
(
54
,
0
,
123
)
tdSql
.
checkData
(
55
,
0
,
None
)
#
tdSql
.
checkData
(
59
,
0
,
123
)
tdSql
.
checkData
(
60
,
0
,
55
)
#
tdSql
.
checkData
(
0
,
1
,
None
)
#
tdSql
.
checkCols
(
5
)
tdSql
.
checkData
(
0
,
1
,
0
)
#
tdSql
.
checkData
(
1
,
1
,
123
)
tdSql
.
checkData
(
4
,
1
,
123
)
tdSql
.
checkData
(
5
,
1
,
None
)
#
...
...
@@ -1817,7 +1830,7 @@ class TDTestCase:
tdSql
.
checkData
(
15
,
1
,
None
)
#
tdSql
.
checkData
(
16
,
1
,
123
)
tdSql
.
checkData
(
19
,
1
,
123
)
tdSql
.
checkData
(
20
,
1
,
None
)
#
tdSql
.
checkData
(
20
,
1
,
20
)
#
tdSql
.
checkData
(
21
,
1
,
123
)
tdSql
.
checkData
(
24
,
1
,
123
)
tdSql
.
checkData
(
25
,
1
,
None
)
#
...
...
@@ -1826,22 +1839,137 @@ class TDTestCase:
tdSql
.
checkData
(
30
,
1
,
30
)
#
tdSql
.
checkData
(
31
,
1
,
123
)
tdSql
.
checkData
(
34
,
1
,
123
)
tdSql
.
checkData
(
35
,
1
,
None
)
#
tdSql
.
checkData
(
35
,
1
,
35
)
#
tdSql
.
checkData
(
36
,
1
,
123
)
tdSql
.
checkData
(
39
,
1
,
123
)
tdSql
.
checkData
(
40
,
1
,
40
)
#
tdSql
.
checkData
(
41
,
1
,
123
)
tdSql
.
checkData
(
44
,
1
,
123
)
tdSql
.
checkData
(
45
,
1
,
45
)
#
tdSql
.
checkData
(
45
,
1
,
None
)
#
tdSql
.
checkData
(
46
,
1
,
123
)
tdSql
.
checkData
(
49
,
1
,
123
)
tdSql
.
checkData
(
50
,
1
,
None
)
#
tdSql
.
checkData
(
50
,
1
,
50
)
#
tdSql
.
checkData
(
51
,
1
,
123
)
tdSql
.
checkData
(
54
,
1
,
123
)
tdSql
.
checkData
(
55
,
1
,
None
)
#
tdSql
.
checkData
(
56
,
1
,
123
)
tdSql
.
checkData
(
59
,
1
,
123
)
tdSql
.
checkData
(
60
,
1
,
60
)
#
tdSql
.
checkData
(
60
,
1
,
55
)
#
tdSql
.
checkData
(
0
,
3
,
None
)
#
tdSql
.
checkData
(
1
,
3
,
456
)
tdSql
.
checkData
(
4
,
3
,
456
)
tdSql
.
checkData
(
5
,
3
,
None
)
#
tdSql
.
checkData
(
6
,
3
,
456
)
tdSql
.
checkData
(
9
,
3
,
456
)
tdSql
.
checkData
(
10
,
3
,
10
)
#
tdSql
.
checkData
(
11
,
3
,
456
)
tdSql
.
checkData
(
14
,
3
,
456
)
tdSql
.
checkData
(
15
,
3
,
None
)
#
tdSql
.
checkData
(
16
,
3
,
456
)
tdSql
.
checkData
(
19
,
3
,
456
)
tdSql
.
checkData
(
20
,
3
,
None
)
#
tdSql
.
checkData
(
21
,
3
,
456
)
tdSql
.
checkData
(
24
,
3
,
456
)
tdSql
.
checkData
(
25
,
3
,
None
)
#
tdSql
.
checkData
(
26
,
3
,
456
)
tdSql
.
checkData
(
29
,
3
,
456
)
tdSql
.
checkData
(
30
,
3
,
30
)
#
tdSql
.
checkData
(
31
,
3
,
456
)
tdSql
.
checkData
(
34
,
3
,
456
)
tdSql
.
checkData
(
35
,
3
,
None
)
#
tdSql
.
checkData
(
36
,
3
,
456
)
tdSql
.
checkData
(
39
,
3
,
456
)
tdSql
.
checkData
(
40
,
3
,
40
)
#
tdSql
.
checkData
(
41
,
3
,
456
)
tdSql
.
checkData
(
44
,
3
,
456
)
tdSql
.
checkData
(
45
,
3
,
45
)
#
tdSql
.
checkData
(
46
,
3
,
456
)
tdSql
.
checkData
(
49
,
3
,
456
)
tdSql
.
checkData
(
50
,
3
,
None
)
#
tdSql
.
checkData
(
51
,
3
,
456
)
tdSql
.
checkData
(
54
,
3
,
456
)
tdSql
.
checkData
(
55
,
3
,
None
)
#
tdSql
.
checkData
(
56
,
3
,
456
)
tdSql
.
checkData
(
59
,
3
,
456
)
tdSql
.
checkData
(
60
,
3
,
60
)
#
tdSql
.
query
(
f
"select _isfilled, interp(c0), _isfilled, interp(c1), _isfilled from
{
dbname
}
.
{
tbname1
}
range('2020-02-02 00:00:00', '2020-02-02 00:01:00') every(1s) fill(value, 123 + 123, 234 + 234)"
)
tdSql
.
checkRows
(
61
)
tdSql
.
checkCols
(
5
)
tdSql
.
checkData
(
0
,
1
,
0
)
#
tdSql
.
checkData
(
1
,
1
,
246
)
tdSql
.
checkData
(
4
,
1
,
246
)
tdSql
.
checkData
(
5
,
1
,
None
)
#
tdSql
.
checkData
(
6
,
1
,
246
)
tdSql
.
checkData
(
9
,
1
,
246
)
tdSql
.
checkData
(
10
,
1
,
10
)
#
tdSql
.
checkData
(
11
,
1
,
246
)
tdSql
.
checkData
(
14
,
1
,
246
)
tdSql
.
checkData
(
15
,
1
,
None
)
#
tdSql
.
checkData
(
16
,
1
,
246
)
tdSql
.
checkData
(
19
,
1
,
246
)
tdSql
.
checkData
(
20
,
1
,
20
)
#
tdSql
.
checkData
(
21
,
1
,
246
)
tdSql
.
checkData
(
24
,
1
,
246
)
tdSql
.
checkData
(
25
,
1
,
None
)
#
tdSql
.
checkData
(
26
,
1
,
246
)
tdSql
.
checkData
(
29
,
1
,
246
)
tdSql
.
checkData
(
30
,
1
,
30
)
#
tdSql
.
checkData
(
31
,
1
,
246
)
tdSql
.
checkData
(
34
,
1
,
246
)
tdSql
.
checkData
(
35
,
1
,
35
)
#
tdSql
.
checkData
(
36
,
1
,
246
)
tdSql
.
checkData
(
39
,
1
,
246
)
tdSql
.
checkData
(
40
,
1
,
40
)
#
tdSql
.
checkData
(
41
,
1
,
246
)
tdSql
.
checkData
(
44
,
1
,
246
)
tdSql
.
checkData
(
45
,
1
,
None
)
#
tdSql
.
checkData
(
46
,
1
,
246
)
tdSql
.
checkData
(
49
,
1
,
246
)
tdSql
.
checkData
(
50
,
1
,
50
)
#
tdSql
.
checkData
(
51
,
1
,
246
)
tdSql
.
checkData
(
54
,
1
,
246
)
tdSql
.
checkData
(
55
,
1
,
None
)
#
tdSql
.
checkData
(
59
,
1
,
246
)
tdSql
.
checkData
(
60
,
1
,
55
)
#
tdSql
.
checkData
(
0
,
3
,
None
)
#
tdSql
.
checkData
(
1
,
3
,
468
)
tdSql
.
checkData
(
4
,
3
,
468
)
tdSql
.
checkData
(
5
,
3
,
None
)
#
tdSql
.
checkData
(
6
,
3
,
468
)
tdSql
.
checkData
(
9
,
3
,
468
)
tdSql
.
checkData
(
10
,
3
,
10
)
#
tdSql
.
checkData
(
11
,
3
,
468
)
tdSql
.
checkData
(
14
,
3
,
468
)
tdSql
.
checkData
(
15
,
3
,
None
)
#
tdSql
.
checkData
(
16
,
3
,
468
)
tdSql
.
checkData
(
19
,
3
,
468
)
tdSql
.
checkData
(
20
,
3
,
None
)
#
tdSql
.
checkData
(
21
,
3
,
468
)
tdSql
.
checkData
(
24
,
3
,
468
)
tdSql
.
checkData
(
25
,
3
,
None
)
#
tdSql
.
checkData
(
26
,
3
,
468
)
tdSql
.
checkData
(
29
,
3
,
468
)
tdSql
.
checkData
(
30
,
3
,
30
)
#
tdSql
.
checkData
(
31
,
3
,
468
)
tdSql
.
checkData
(
34
,
3
,
468
)
tdSql
.
checkData
(
35
,
3
,
None
)
#
tdSql
.
checkData
(
36
,
3
,
468
)
tdSql
.
checkData
(
39
,
3
,
468
)
tdSql
.
checkData
(
40
,
3
,
40
)
#
tdSql
.
checkData
(
41
,
3
,
468
)
tdSql
.
checkData
(
44
,
3
,
468
)
tdSql
.
checkData
(
45
,
3
,
45
)
#
tdSql
.
checkData
(
46
,
3
,
468
)
tdSql
.
checkData
(
49
,
3
,
468
)
tdSql
.
checkData
(
50
,
3
,
None
)
#
tdSql
.
checkData
(
51
,
3
,
468
)
tdSql
.
checkData
(
54
,
3
,
468
)
tdSql
.
checkData
(
55
,
3
,
None
)
#
tdSql
.
checkData
(
56
,
3
,
468
)
tdSql
.
checkData
(
59
,
3
,
468
)
tdSql
.
checkData
(
60
,
3
,
60
)
#
# test fill prev
tdSql
.
query
(
f
"select interp(c0),interp(c1) from
{
dbname
}
.
{
tbname1
}
range('2020-02-02 00:00:00', '2020-02-02 00:01:00') every(1s) fill(prev)"
)
...
...
@@ -2016,7 +2144,7 @@ class TDTestCase:
tdSql
.
checkData
(
3
,
i
,
None
)
tdSql
.
checkData
(
4
,
i
,
None
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(value, 1)"
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(value, 1
, 1, 1, 1
)"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkCols
(
4
)
...
...
@@ -2442,6 +2570,10 @@ class TDTestCase:
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
where _isfilled = true range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
where _irowts > 0 range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(null)"
)
# fill value number mismatch
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(value, 1, 2)"
)
tdSql
.
error
(
f
"select interp(c0), interp(c1) from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05') every(1d) fill(value, 1)"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录