George Leonard
07/02/2024, 3:33 PM{
"INVNUMBER": "7f1108a1-6d25-4776-a815-0d7d7e332e14",
"SALEDATETIME": "2024-07-02T16:25:25.269+02:00",
"SALETIMESTAMP": "1719930325269",
"TERMINALPOINT": "13",
"NETT": 1721.94,
"VAT": 241.07,
"TOTAL": 1963.01,
"STORE": {
"ID": "324213441",
"NAME": "Milnerton"
},
"CLERK": {
"ID": "10014",
"NAME": "Winston"
},
"BASKETITEMS": [
{
"ID": "000000014",
"NAME": "Coca-Cola Soft Drink 1.5L",
"BRAND": "Coka Coke",
"CATEGORY": "Beverage",
"PRICE": 18.49,
"QUANTITY": 2
},
{
"ID": "000000038",
"NAME": "PnP Full Cream Fresh Milk 2L",
"BRAND": "PnP",
"CATEGORY": "Food Cupboard",
"PRICE": 34.99,
"QUANTITY": 3
}
],
"FINTRANSACTIONID": "577d5cd8-9536-4989-88b0-89c41aa45998",
"PAYDATETIME": "2024-07-02T16:25:43.269+02:00",
"PAYTIMESTAMP": "1719930343269",
"PAID": 1963.01
}
I want to run a query like this (this is the Kafka kTable version): basically creating a total salescompleted per terminal per minute per store_id (I will change this to per hour later/more real world...)
CREATE TABLE avro_sales_per_terminal_point WITH (KAFKA_TOPIC='avro_sales_per_terminal_point',
FORMAT='AVRO',
PARTITIONS=1)
as
SELECT
store->id as store_id,
TerminalPoint as terminal_point,
count(1) as sales_per_terminal
FROM pb_salescompleted
WINDOW TUMBLING (SIZE 1 MINUTE)
group by store->id , TerminalPoint
EMIT FINAL;
can someone assist with what the flink version you be like...
I realise... from online examples i have to first create a flink table and then I run my select / group by on that which output/emit the valuesGeorge Leonard
07/03/2024, 1:17 PM