Flink Table API Sum method

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

Flink Table API Sum method

Soheil Pourbafrani
Hi,

How can I use the Flink Table API SUM function? For example something like this:
table.agg(sum("feild1"))
Reply | Threaded
Open this post in threaded view
|

Re: Flink Table API Sum method

Dawid Wysakowicz-2
Hi,

It depends if you are using scala or java.

In scala: table.agg('field1.sum)

In java (this should work in scala as well): table("field1.sum")

More examples you can find in the docs[1]

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.7/dev/table/tableApi.html#aggregations

On 29/01/2019 15:13, Soheil Pourbafrani wrote:
> Hi,
>
> How can I use the Flink Table API SUM function? For example something
> like this:
> table.agg(sum("feild1"))


signature.asc (849 bytes) Download Attachment