# 'twa(speed)', # TODO: this one REQUIRES a where statement, not reasonable
'sum(speed)',
'stddev(speed)',
# SELECTOR functions
'min(speed)',
'max(speed)',
'first(speed)',
'last(speed)',
'apercentile(speed, 10)',# TODO: TD-1316
'last_row(*)',# TODO: commented out per TD-3231, we should re-create
# Transformation Functions
'twa(speed)'
])# TODO: add more from 'top'
stream_sql=''# set default value
ifsub_tables:
ifsub_tables:
ifsub_tables:# if not empty
sub_tbname=sub_tables[0]
sub_tbname=sub_tables[0]
# create stream with query above sub_table
# create stream with query above sub_table
stream_sql='create stream {} into {}.{} as select {}, avg(speed) FROM {}.{} PARTITION BY tbname INTERVAL(5s) SLIDING(3s) '.format(sub_stream_name,dbname,sub_stream_tb_name,aggExpr,dbname,sub_tbname)
stream_sql='create stream {} into {}.{} as select {}, avg(speed) FROM {}.{} PARTITION BY tbname INTERVAL(5s) SLIDING(3s) '.\
Logging.debug("[OPS] stream is creating at {}".format(time.time()))
excepttaos.error.ProgrammingErroraserr:
errno=Helper.convertErrno(err.errno)
iferrnoin[0x03f0]:# stream already exists
# stream need drop before drop table
pass
else:
pass
else:
else:
stream_sql='create stream {} into {}.{} as select {}, avg(speed) FROM {}.{} PARTITION BY tbname INTERVAL(5s) SLIDING(3s) '.format(super_stream_name,dbname,super_stream_tb_name,aggExpr,dbname,stbname)
stream_sql='create stream {} into {}.{} as select {}, avg(speed) FROM {}.{} PARTITION BY tbname INTERVAL(5s) SLIDING(3s) '.\