Hi, one more question on KSQL CLI:
using "run script /myScript.ksql" commands I can run scripts with "CREATE
STREAM ..." and "CREATE TABLE ..." commands - no problem.
However, when I try to run a script with a SELECT statement, I'm getting an
error:
Script: top3_reqtime.ksql
SELECT payload->sitekey,
windowStart() as window_start,
windowEnd() as window_end,
TOPK(request_time, 3) as top_3_request_times
FROM rc_events_full
WINDOW TUMBLING (SIZE 30 SECONDS)
GROUP BY payload->sitekey;
Results from CLI:
ksql> run script /ksql-scripts/top3_reqtime.ksql;
SELECT and PRINT queries must use the /query endpoint
ksql>
If I run the same query directly from the CLI - it works just fine:
ksql> SELECT payload->sitekey,
> windowStart() as window_start,
> windowEnd() as window_end,
> TOPK(request_time, 3) as top_3_request_times
>FROM rc_events_full
>WINDOW TUMBLING (SIZE 30 SECONDS)
>GROUP BY payload->sitekey;
8vGuAWfMScPzFg | 1557193020000 | 1557193050000 | [0.014]
8vGuAWfMScPzFg | 1557193050000 | 1557193080000 | [0.062]
Why can't I execute this query from a script?
Thank you!
Marina
Sent with [ProtonMail](https://protonmail.com) Secure Email.