在蜂巢中得到大量的数量(get avg of count in hive)
我正在尝试获取计数查询结果的平均值,在hive的文档中我读到它是不可能的,因此我尝试了它:1º
CREATE VIEW clicks_pais_totalView AS SELECT p.pais as pais, count(1) as numeroClicks FROM clicks_data_mat p WHERE p.pais is not NULL GROUP BY p.pais;
2º
CREATE TABLE clicks_pais_total AS SELECT * FROM clicks_pais_totalView; ALTER TABLE clicks_pais_total CHANGE numeroClicks numeroClicksInt INT;
3º
SELECT pais as pais, avg(DISTINCT numeroclicksint) FROM clicks_pais_total GROUP BY pais;
平均结果总是与第一个查询计数返回我一样,有什么不对?
I am trying get the avg of the result of a count query, in the documentation of hive I read it is impossible and for this reason I try it: 1º
CREATE VIEW clicks_pais_totalView AS SELECT p.pais as pais, count(1) as numeroClicks FROM clicks_data_mat p WHERE p.pais is not NULL GROUP BY p.pais;
2º
CREATE TABLE clicks_pais_total AS SELECT * FROM clicks_pais_totalView; ALTER TABLE clicks_pais_total CHANGE numeroClicks numeroClicksInt INT;
3º
SELECT pais as pais, avg(DISTINCT numeroclicksint) FROM clicks_pais_total GROUP BY pais;
The avg result always is the same the first query of count returned me, what is wrong?
原文:https://stackoverflow.com/questions/30291409
更新时间:2023-09-22 18:09
最满意答案
使用这些头衔的公司。 标题并不是真正的老实说。
The company that use those titles. Title don't really mean much honestly.
相关问答
更多-
SolidWorks Pro ENGINEER4.0 教程[2023-06-05]
SolidWorks Pro ENGINEER4.0 教程这方面的资料这个网站最全 http://www.ugug8.com/main.asp百分百的工厂视频超级经典,高效快速的自学首选资料,供参考希望对你有所帮助 -
Pro/ENGINEER Wildfire 4.0全部视频教程[2022-05-07]
com/v_show/id_XNzc5Njc5MDg=,一共4个,只要你认认真真听完,proe基本功能绝对搞定://vhttp.youku.html 优酷网上的视频教程 -
pro/engineer视频教程下载[2023-07-27]
网站你可以去 www.proe.cn 看看 论坛里资料很全的 下载视频的话可以到 bt.btchina.net 搜索一下 我记得有的 -
Grails 2.x(以及1.x)此插件现在位于默认情况下未包含在BuildConfig.groovy中的存储库中。 您需要将以下Maven仓库添加到依赖关系解析块。 grails.project.dependency.resolution = { repositories { mavenRepo "http://repo.grails.org/grails/repo/" ... Grails 2.x (and 1.x for that matter) plugi ...
-
反向工程C ++ DLL(Reverse engineer C++ DLL)[2023-10-31]
Hex-Rays反编译器是一个很好的工具,但代码很难读取,你将不得不花费大量的时间对整个DLL进行反向工程。 Hex-Rays decompiler is a great tool, but the code will be quite hard to read and you will have to spend a lot of time to reverse engineer the whole DLL. -
检查汇编代码。 把它变回C ++。 利润。 不可否认,你可以在第1步和第2步中添加一些细节,但这是基本的想法,我的答案中的详细程度超过了你问题中的详细程度:-) Examine the assembler code. Turn it back into C++. Profit. Admittedly, there a fair bit of detail you could add to steps 1 and 2 but that's the basic idea, and the level of de ...
-
使用这些头衔的公司。 标题并不是真正的老实说。 The company that use those titles. Title don't really mean much honestly.
-
您需要在grails-app/conf/DataSource.groovy配置数据库。 特别是,您需要提供JDBC URL,数据库方言以及数据库的用户名和密码。 您还需要在grails-app/conf/Config.groovy添加一些额外的db-reverse-engineer配置。 该文件已存在。 只需在最后添加新属性即可。 最后,运行反向工程脚本来生成域类: grails db-reverse-engineer You need to configure your database in grai ...
-
如何决定:从零开始构建或逆向工程现成的解决方案(How to decide: build from scratch or reverse engineer off the shelf solution)[2024-03-30]
在构建克隆时,我会更自在地从头开始,因为你有一个很好的,经过验证的例子。 (最终规范!)如果您尝试评估/实施其他系统以匹配现有产品,那么当基本代码无法实现最终目标时,您将更有可能遇到严重的问题。 我也同意你的所有维护考虑因素。 此外,评估系统既耗时又不万无一失。 我曾经花了一个月的时间来决定第三方网格,最后它基本上就是掷骰子。 我评估了十几种产品一个月。 我可以触摸多少功能? 5%也许。 In building a clone i would be more comfortable going from s ...