Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2822245a
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看板
未验证
提交
2822245a
编写于
7月 17, 2023
作者:
D
dapan1121
提交者:
GitHub
7月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22076 from wangjiaming0909/fix/m/TD-25199
fix: create sma index for us/ns database failed
上级
d58ec17e
ee7c8289
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
51 addition
and
1 deletion
+51
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+2
-1
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/system-test/0-others/sma_index.py
tests/system-test/0-others/sma_index.py
+48
-0
未找到文件。
source/libs/parser/src/parTranslater.c
浏览文件 @
2822245a
...
...
@@ -3409,7 +3409,8 @@ static int32_t checkIntervalWindow(STranslateContext* pCxt, SIntervalWindowNode*
if
(
IS_CALENDAR_TIME_DURATION
(
pSliding
->
unit
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_SLIDING_UNIT
);
}
if
((
pSliding
->
datum
.
i
<
convertTimePrecision
(
tsMinSlidingTime
,
TSDB_TIME_PRECISION_MILLI
,
precision
))
||
if
((
pSliding
->
datum
.
i
<
convertTimeFromPrecisionToUnit
(
tsMinSlidingTime
,
TSDB_TIME_PRECISION_MILLI
,
pSliding
->
unit
))
||
(
pInter
->
datum
.
i
/
pSliding
->
datum
.
i
>
INTERVAL_SLIDING_FACTOR
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INTER_SLIDING_TOO_SMALL
);
}
...
...
tests/parallel_test/cases.task
浏览文件 @
2822245a
...
...
@@ -342,6 +342,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/smaBasic.py -N 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/smaTest.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/smaTest.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/sma_index.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/spread.py
...
...
tests/system-test/0-others/sma_index.py
0 → 100644
浏览文件 @
2822245a
import
taos
import
sys
import
time
import
socket
import
os
import
threading
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
class
TDTestCase
:
hostname
=
socket
.
gethostname
()
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
#tdSql.init(conn.cursor())
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
# output sql.txt file
def
create_databases
(
self
):
tdSql
.
execute
(
"create database db_ms precision 'ms'"
)
tdSql
.
execute
(
"create database db_us precision 'us'"
)
tdSql
.
execute
(
"create database db_ns precision 'ns'"
)
def
create_stables
(
self
):
tdSql
.
execute
(
"CREATE STABLE db_ms.`meters` (`ts` TIMESTAMP, `c0` INT, `c1` TINYINT, `c2` DOUBLE, `c3` VARCHAR(64), `c4` NCHAR(64)) TAGS (`cc` VARCHAR(16))"
)
tdSql
.
execute
(
"CREATE STABLE db_us.`meters` (`ts` TIMESTAMP, `c0` INT, `c1` TINYINT, `c2` DOUBLE, `c3` VARCHAR(64), `c4` NCHAR(64)) TAGS (`cc` VARCHAR(16))"
)
tdSql
.
execute
(
"CREATE STABLE db_ns.`meters` (`ts` TIMESTAMP, `c0` INT, `c1` TINYINT, `c2` DOUBLE, `c3` VARCHAR(64), `c4` NCHAR(64)) TAGS (`cc` VARCHAR(16))"
)
def
create_sma_index
(
self
):
tdSql
.
execute
(
"create sma index sma_index_ms on db_ms.meters function(max(c1), max(c2), min(c1)) interval(6m, 10s) sliding(6m)"
)
tdSql
.
execute
(
"create sma index sma_index_us on db_us.meters function(max(c1), max(c2), min(c1)) interval(6m, 10s) sliding(6m)"
)
tdSql
.
execute
(
"create sma index sma_index_ns on db_ns.meters function(max(c1), max(c2), min(c1)) interval(6m, 10s) sliding(6m)"
)
def
run
(
self
):
tdSql
.
prepare
()
self
.
create_databases
()
self
.
create_stables
()
self
.
create_sma_index
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录