fix(schema): escape TDengine 3.4 reserved words 'value'/'label' and use column alias for ANOMALY_WINDOW
- schema: rename label -> is_anomaly, escape `value` as backtick - detection/forecast: wrap subquery with SELECT ts, `value` AS v so ANOMALY_WINDOW/FORECAST receive non-keyword column name - resolves [0x2600] syntax error and unblocks E2E pipeline on community tsdb 3.4.1
This commit is contained in:
@@ -28,8 +28,8 @@ def run_anomaly_window(conn, stable: str, algo: str) -> list[tuple[int, int]]:
|
||||
|
||||
sql = (
|
||||
f"SELECT _WSTART, _WEND "
|
||||
f"FROM (ANOMALY_WINDOW(value, \"algo={algo}\") "
|
||||
f"FROM ds_{stable})"
|
||||
f"FROM (SELECT ts, `value` AS v FROM ds_{stable}) "
|
||||
f"ANOMALY_WINDOW(v, 'algo={algo}')"
|
||||
)
|
||||
|
||||
rows = conn.execute(sql)
|
||||
|
||||
Reference in New Issue
Block a user