Merge pull request #25961 from taosdata/test/TS-4847-3.0

TS-4847: add test case
This commit is contained in:
Alex Duan 2024-05-29 16:53:23 +08:00 committed by GitHub
commit 8cf5beb3a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 0 deletions

View File

@ -15,6 +15,30 @@ class TDTestCase:
#tdSql.init(conn.cursor())
tdSql.init(conn.cursor(), logSql) # output sql.txt file
def interp_on_empty_table(self):
dbname = "db"
tbname = "t"
tdSql.prepare()
tdLog.printNoPrefix("==========step1:create table")
tdSql.execute(f'''create table if not exists {dbname}.{tbname} (ts timestamp, k int)''')
tdLog.printNoPrefix("==========step2:interp query on empty table")
tdSql.query(f"select _irowts, interp(k),k from {dbname}.{tbname} partition by k range(now()-1h, now()) every(1m) fill(prev)")
tdSql.checkRows(0)
tdSql.query(f"select _irowts, interp(k),k from {dbname}.{tbname} partition by k range(now()-1h, now()) every(1m) fill(next)")
tdSql.checkRows(0)
tdSql.query(f"select _irowts, interp(k),k from {dbname}.{tbname} partition by k range(now()-1h, now()) every(1m) fill(linear)")
tdSql.checkRows(0)
tdSql.query(f"select _irowts, interp(k),k from {dbname}.{tbname} partition by k range(now()-1h, now()) every(1m) fill(value, 2)")
tdSql.checkRows(0)
def run(self):
dbname = "db"
tbname = "tb"
@ -5658,6 +5682,7 @@ class TDTestCase:
tdSql.checkData(0, 0, '2023-08-06 23:59:00')
tdSql.checkData(0, 1, None)
self.interp_on_empty_table()
def stop(self):