Mohammed,
The `events_per_type` table example that I provided before produces the
same output shown below; except of course for the percentage which can
be easily computed as well.
Thanks,
-- Ricardo
On 6/5/20 10:46 AM, Mohammed Ait Haddou wrote:
Thanks a lot for the reply.
But, I want tot
Thanks a lot for the reply.
But, I want total number of all events and the count for each event type
into a single table as I mentioned.
Similar results :
++---++
| Event_type | Count | Percentage |
++---++
|view| 6 | 0.5|
Mohammed,
The first thing you need to do is making sure to set a key for this
stream. This can be accomplished either in the creation statement or
creating a new stream and using the *PARTITION BY* clause. For the sake
of simplicity; the example below uses the creation statement strategy:
``
I have a stream with an event_type field, possible values are (view, cart,
purchase).
CREATE STREAM events(event_type STRING)
WITH (KAFKA_TOPIC='events', VALUE_FORMAT='DELIMITED');
I want to count the total number of all events and the number of events for
each event_type into a single table.