Accumulators in Table API

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Accumulators in Table API

Flavio Pompermaier
Hi to all,
in my legacy code (using Dataset api) I used to add a map function just after the Source read and keep the count of the rows. In this way I had a very light and unobtrusive way of counting the rows of a dataset. Can I do something similar in table API? Is there a way to use accumulators?

Thanks in advance,
Flavio
Reply | Threaded
Open this post in threaded view
|

Re: Accumulators in Table API

Dawid Wysakowicz-2
Hi Flavio.

You don't have access to accumulators in Table API.

A few other ways that come to my mind are:

1. Use existing metrics e.g. operator input/output records.

2. Use metrics in a UDF

3. Have a regular count (you can have multiple queries optimized into a
single graph via TableEnvironment#createStatementSet)

Best,

Dawid

On 16/07/2020 09:36, Flavio Pompermaier wrote:
> Hi to all,
> in my legacy code (using Dataset api) I used to add a map function
> just after the Source read and keep the count of the rows. In this way
> I had a very light and unobtrusive way of counting the rows of a
> dataset. Can I do something similar in table API? Is there a way to
> use accumulators?
>
> Thanks in advance,
> Flavio


signature.asc (849 bytes) Download Attachment