Distinct aggregation is not currently supported on data stream with Table/SQL API. This is an umbrella task for enabling distinct aggregation in various use cases.
Discussion doc can be found here: https://docs.google.com/document/d/1zj6OA-K2hi7ah8Fo-xTQB-mVmYfm6LsN2_NHgTCVmJI/edit?usp=sharing
Distinct aggregation is a very important feature in SQL processing and there are many JIRAs currently open with various use cases. The goal is to create one solution to both unbounded and bounded distinct aggregation on data stream so that it can easily be extended to support these use cases.