• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


26 Feb, 2025

Updated at 21 Mar, 2025

Why doesn't the use of distinct in my window function take effect?

Version: HDP Hive 3.1.3. data is:

name day
a 01
a 01
a 01
b 01
c 01

sql is: select day, name, count(distinct name) as cnt from tablea;

restult is:

day name cnt
01 a 5
01 a 5
01 a 5
01 b 5
01 c 5
day name cnt
01 a 3
01 a 3
01 a 3
01 b 3
01 c 3