Use Case- Travel speed - players moving faster than others or even possibly teleporting.
I have below data.
Playerid |
gameid |
Xcoordinate |
Ycoordinate |
Zcoordinate |
Timestamp |
1 |
100 |
10 |
20 |
30 |
5/11/2023 5:50 |
1 |
100 |
10 |
21 |
30 |
5/11/2023 5:53 |
1 |
100 |
11 |
20 |
33 |
5/11/2023 5:56 |
1 |
100 |
12 |
20 |
30 |
5/11/2023 5:59 |
1 |
100 |
12 |
25 |
10 |
5/11/2023 6:02 |
1 |
100 |
13 |
20 |
30 |
5/11/2023 6:05 |
Now I want to calculate average moving time from place 1 to place 2.
Note place is been given in (x,y,z) coordinate.
Is there any way we can calculate above problem?
Hi @tushar ,
I realize this response may be out-of-date, but I’m assuming you’re using Kafka? We can then use KStreams or Flink for this, but first I’d need to know: this is not a batch of data, correct? This is an average updating in real time that you need?
PS: for anyone else looking at this looking for an example of a moving average with Flink, check out https://flink-st-kafka.streamlit.app/.
Here, you can see that this was accomplished using this query:
INSERT INTO tumble_interval
SELECT symbol, DATE_FORMAT(window_start,'yyyy-MM-dd hh:mm:ss.SSS'), DATE_FORMAT(window_end,'yyyy-MM-dd hh:mm:ss.SSS'), AVG(price)
FROM TABLE(
TUMBLE(TABLE SPY, DESCRIPTOR($rowtime), INTERVAL '5' SECONDS))
GROUP BY
symbol,
window_start,
window_end;