tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)")
tdSql.checkRows(48)
foriinrange(0,18):
tdSql.checkData(i,0,'ctb1')
foriinrange(18,34):
tdSql.checkData(i,0,'ctb2')
foriinrange(34,48):
tdSql.checkData(i,0,'ctb3')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(17,1,'2020-02-01 00:00:18.000')
tdSql.checkData(18,1,'2020-02-01 00:00:03.000')
tdSql.checkData(33,1,'2020-02-01 00:00:18.000')
tdSql.checkData(34,1,'2020-02-01 00:00:05.000')
tdSql.checkData(47,1,'2020-02-01 00:00:18.000')
foriinrange(0,6):
tdSql.checkData(i,3,1)
foriinrange(6,12):
tdSql.checkData(i,3,7)
foriinrange(12,18):
tdSql.checkData(i,3,13)
foriinrange(18,24):
tdSql.checkData(i,3,3)
foriinrange(24,30):
tdSql.checkData(i,3,9)
foriinrange(30,34):
tdSql.checkData(i,3,15)
foriinrange(34,40):
tdSql.checkData(i,3,5)
foriinrange(40,46):
tdSql.checkData(i,3,11)
foriinrange(46,48):
tdSql.checkData(i,3,17)
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)")
tdSql.checkRows(48)
foriinrange(0,14):
tdSql.checkData(i,0,'ctb1')
foriinrange(14,30):
tdSql.checkData(i,0,'ctb2')
foriinrange(30,48):
tdSql.checkData(i,0,'ctb3')
tdSql.checkData(0,1,'2020-02-01 00:00:00.000')
tdSql.checkData(13,1,'2020-02-01 00:00:13.000')
tdSql.checkData(14,1,'2020-02-01 00:00:00.000')
tdSql.checkData(29,1,'2020-02-01 00:00:15.000')
tdSql.checkData(30,1,'2020-02-01 00:00:00.000')
tdSql.checkData(47,1,'2020-02-01 00:00:17.000')
foriinrange(0,2):
tdSql.checkData(i,3,1)
foriinrange(2,8):
tdSql.checkData(i,3,7)
foriinrange(8,14):
tdSql.checkData(i,3,13)
foriinrange(14,18):
tdSql.checkData(i,3,3)
foriinrange(18,24):
tdSql.checkData(i,3,9)
foriinrange(24,30):
tdSql.checkData(i,3,15)
foriinrange(30,36):
tdSql.checkData(i,3,5)
foriinrange(36,42):
tdSql.checkData(i,3,11)
foriinrange(42,48):
tdSql.checkData(i,3,17)
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)")
tdSql.checkRows(39)
foriinrange(0,13):
tdSql.checkData(i,0,'ctb1')
foriinrange(13,26):
tdSql.checkData(i,0,'ctb2')
foriinrange(26,39):
tdSql.checkData(i,0,'ctb3')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(12,1,'2020-02-01 00:00:13.000')
tdSql.checkData(13,1,'2020-02-01 00:00:03.000')
tdSql.checkData(25,1,'2020-02-01 00:00:15.000')
tdSql.checkData(26,1,'2020-02-01 00:00:05.000')
tdSql.checkData(38,1,'2020-02-01 00:00:17.000')
foriinrange(0,13):
tdSql.checkData(i,3,i+1)
foriinrange(13,26):
tdSql.checkData(i,3,i-10)
foriinrange(26,39):
tdSql.checkData(i,3,i-21)
# select interp from supertable partition by column
tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)")
tdSql.checkRows(171)
tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)")
tdSql.checkRows(171)
tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)")
tdSql.checkRows(90)
tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)")
tdSql.checkRows(90)
tdSql.query(f"select c0, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by c0 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)")
tdSql.checkRows(9)
# select interp from supertable partition by tag
tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(null)")
tdSql.checkRows(57)
tdSql.checkData(0,2,None)
tdSql.checkData(1,2,1)
tdSql.checkData(2,2,None)
tdSql.checkData(3,2,3)
tdSql.checkData(4,2,None)
tdSql.checkData(5,2,5)
tdSql.checkData(6,2,None)
tdSql.checkData(7,2,7)
tdSql.checkData(8,2,None)
tdSql.checkData(9,2,9)
tdSql.checkData(10,2,None)
tdSql.checkData(11,2,11)
tdSql.checkData(12,2,None)
tdSql.checkData(13,2,13)
tdSql.checkData(14,2,None)
tdSql.checkData(15,2,15)
tdSql.checkData(16,2,None)
tdSql.checkData(17,2,17)
tdSql.checkData(18,2,None)
tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(value, 0)")
tdSql.checkRows(57)
tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(prev)")
tdSql.checkRows(48)
tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(next)")
tdSql.checkRows(48)
tdSql.query(f"select t1, _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by t1 range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)")
tdSql.checkRows(39)
# select interp from supertable filter
tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)")
tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear)")
tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 40")
tdSql.checkRows(39)
tdSql.query(f"select _irowts, _isfilled, interp(c0) from {dbname}.{stbname} where ts between '2020-02-01 00:00:01.000' and '2020-02-01 00:00:13.000' partition by tbname range('2020-02-01 00:00:00', '2020-02-01 00:00:18') every(1s) fill(linear) limit 10")