semanticexception[error 10128]:行1:33还不支持udaf'sum'的位置

wrrgggsh  于 2021-06-25  发布在  Hive
关注(0)|答案(1)|浏览(1144)

我的命令是:

  1. select name_of_state, max(total_confirmed_cases/sum(total_confirmed_cases)) from total_india_case;

我有个错误:

  1. FAILED: SemanticException [Error 10128]: Line 1:33 Not yet supported place for UDAF 'sum'

plzzz帮助

ukxgm1gy

ukxgm1gy1#

因为没有使用GROUPBY子句,所以出现错误。不能这样使用聚合函数。
我不知道你想达到什么目的,但假设你想得到的国家名称有最大比例的总确诊病例到整个印度。

  1. With total_sum as (
  2. Select sum(total_confirmed_cases) total from total_india_case)
  3. Select name_of_state, max(total_confirmed_cases)/total from total_india_case
  4. left outer join total_sum on 1=1
  5. group by name_of_state, total limit;

相关问题