gpt4 book ai didi

hadoop - hive :SELECT AS 和 GROUP BY

转载 作者:可可西里 更新时间:2023-11-01 14:12:33 24 4
gpt4 key购买 nike

我有一个类似

的 Hive 查询
SELECT Year, Month, Day, Hours, Minutes,
cast((cast(Seconds as int)/15) as int)*15
AS secondMod, Count(*) AS PerCount FROM LoggerTable
GROUP BY Year, Month, Day, Hours, Minutes, secondMod
ORDER BY PerCount;

上述查询因错误而失败

FAILED: Error in semantic analysis: line 1:175 Invalid Table Alias or Column Reference secondMod

'LoggerTable' 是一个 Hive 表,所有列都是字符串类型。

这个问题有什么解决方法吗?

最佳答案

试试这个:

SELECT Year, Month, Day, Hours, Minutes, 
cast((cast(Seconds as int)/15) as int)*15
AS secondMod, Count(*) AS PerCount FROM LoggerTable
GROUP BY Year, Month, Day, Hours, Minutes,
cast((cast(Seconds as int)/15) as int)*15
ORDER BY PerCount;

关于hadoop - hive :SELECT AS 和 GROUP BY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12600049/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com