tmqCom.insert_rows_into_ntbl(tdSql,dbname=paraDict["dbName"],tbname_prefix="ntb",tbname_index_start_num=1,column_ele_list=paraDict["colSchema"],startTs=paraDict["startTs"],tblNum=1,rows=2)# tdLog.info("restart taosd to ensure that the data falls into the disk")
tmqCom.insert_rows_into_ntbl(tdSql,dbname=paraDict["dbName"],tbname_prefix="ntb",tbname_index_start_num=1,column_ele_list=paraDict["colSchema"],startTs=paraDict["startTs"],tblNum=1,rows=2)# tdLog.info("restart taosd to ensure that the data falls into the disk")
tdLog.info("create topics from super table and normal table")
columnTopicFromStb='column_topic_from_stb2'
columnTopicFromNtb='column_topic_from_ntb2'
tdSql.execute("create topic %s as select ts, c1, c2, t1, t2 from %s.%s where c3 > 3 and c4 like 'abc' and t3 = 5 and t4 = 'beijing'"%(columnTopicFromStb,parameterDict['dbName'],parameterDict['stbName']))
tdSql.execute("create topic %s as select ts, c1, c2 from %s.%s where c3 > 3 and c4 like 'abc'"%(columnTopicFromNtb,parameterDict['dbName'],ntbName))
tdLog.info("======== super table test:")
# alter actions prohibited: drop column/tag, modify column/tag type, rename column/tag included in topic
tdSql.error("alter table %s.%s drop column c1"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop column c2"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop column c3"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop column c4"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop column c4"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop tag t1"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop tag t2"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop tag t2"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop tag t3"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.error("alter table %s.%s drop tag t4"%(parameterDict['dbName'],parameterDict['stbName']))
tdSql.execute("create topic %s as select ts, c1, c2, t1, t2 from %s.%s where c3 > 3 and c4 like 'abc' and t3 = 5 and t4 = 'beijing'"%(columnTopicFromCtb,parameterDict['dbName'],ctbName))
# alter actions prohibited: drop column/tag, modify column/tag type, rename column/tag included in topic
tdSql.execute("create topic %s as select c1, c2, c3 from %s.%s where t1 > 10 and t2 = 'beijign' and sin(t3) < 0"%(columnTopicFromCtb,parameterDict['dbName'],ctbName))