tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(NULL)")
tdSql.checkRows(27)
foriinrange(0,9):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(9,18):
tdSql.checkData(i,0,'ctb2_null')
foriinrange(18,27):
tdSql.checkData(i,0,'ctb3_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(8,1,'2020-02-01 00:00:17.000')
tdSql.checkData(9,1,'2020-02-01 00:00:01.000')
tdSql.checkData(17,1,'2020-02-01 00:00:17.000')
tdSql.checkData(18,1,'2020-02-01 00:00:01.000')
tdSql.checkData(26,1,'2020-02-01 00:00:17.000')
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(NULL)")
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(value, 0)")
tdSql.checkRows(27)
foriinrange(0,9):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(9,18):
tdSql.checkData(i,0,'ctb2_null')
foriinrange(18,27):
tdSql.checkData(i,0,'ctb3_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(8,1,'2020-02-01 00:00:17.000')
tdSql.checkData(9,1,'2020-02-01 00:00:01.000')
tdSql.checkData(17,1,'2020-02-01 00:00:17.000')
tdSql.checkData(18,1,'2020-02-01 00:00:01.000')
tdSql.checkData(26,1,'2020-02-01 00:00:17.000')
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(value, 0)")
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(prev)")
tdSql.checkRows(14)
foriinrange(0,9):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(9,13):
tdSql.checkData(i,0,'ctb2_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(8,1,'2020-02-01 00:00:17.000')
tdSql.checkData(9,1,'2020-02-01 00:00:09.000')
tdSql.checkData(13,1,'2020-02-01 00:00:17.000')
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(prev)")
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)")
tdSql.checkRows(15)
foriinrange(0,7):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(7,15):
tdSql.checkData(i,0,'ctb2_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(6,1,'2020-02-01 00:00:13.000')
tdSql.checkData(7,1,'2020-02-01 00:00:01.000')
tdSql.checkData(14,1,'2020-02-01 00:00:15.000')
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(next)")
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0, 1) from {dbname}.{stbname_null} partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(linear)")
tdSql.checkRows(11)
foriinrange(0,7):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(7,11):
tdSql.checkData(i,0,'ctb2_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(6,1,'2020-02-01 00:00:13.000')
tdSql.checkData(7,1,'2020-02-01 00:00:09.000')
tdSql.checkData(10,1,'2020-02-01 00:00:15.000')
tdSql.query(f"select tbname, _irowts, _isfilled, interp(c0) from {dbname}.{stbname_null} where c0 is not null partition by tbname range('2020-02-01 00:00:01', '2020-02-01 00:00:17') every(2s) fill(linear)")
tdSql.checkRows(11)
foriinrange(0,7):
tdSql.checkData(i,0,'ctb1_null')
foriinrange(7,11):
tdSql.checkData(i,0,'ctb2_null')
tdSql.checkData(0,1,'2020-02-01 00:00:01.000')
tdSql.checkData(6,1,'2020-02-01 00:00:13.000')
tdSql.checkData(7,1,'2020-02-01 00:00:09.000')
tdSql.checkData(10,1,'2020-02-01 00:00:15.000')
tdLog.printNoPrefix("======step 15: test interp pseudo columns")
tdSql.error(f"select _irowts, c6 from {dbname}.{tbname}")