Skip to content
Advertisement

Count distinct with HUE/IMPALA

I have a table in HUE like :

I need to count the distinct number of ProductID’s for each ID.

Something like this :

I’ve tried :

What I really need to do is a count(distinct) inside the analytical function. HUE doesn’t let me do this.

Is there another way I can count distinct for window of rows?

Advertisement

Answer

Your sample data is confusing. However, you can work around the limitation on analytical distinct counts with a subquery and a join:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement