计算Hadoop Hive中多列的平均值(Calculating an Average across multiple columns in Hadoop Hive)
我试图在Hive中计算平均三列,但没有运气。 以下是我的代码。
select c.university_name, c.country, AVG(c.world_rank) as AvgC, AVG(s.world_rank) as AvgS, AVG(t.world_rank) as AvgT, SUM(AvgC+AvgS+AvgT)/3 as TotalAvg from cwur c join shanghai s on (c.university_name = s.university_name and c.year = s.year) join times t on (c.university_name = t.university_name and c.year = t.year)
Hive甚至能够在三个计算列上进行平均吗?
I am trying to calculate an average of three columns in Hive but with no luck. Below is my code.
select c.university_name, c.country, AVG(c.world_rank) as AvgC, AVG(s.world_rank) as AvgS, AVG(t.world_rank) as AvgT, SUM(AvgC+AvgS+AvgT)/3 as TotalAvg from cwur c join shanghai s on (c.university_name = s.university_name and c.year = s.year) join times t on (c.university_name = t.university_name and c.year = t.year)
Is Hive even capable of averaging across three calculated columns?
原文:https://stackoverflow.com/questions/36958985
更新时间:2023-09-25 20:09
最满意答案
将domain.com/mydomain/file.extention更改为domain.com/file.extention
以此为例
RewriteRule ^mydomain/(.+)$ http://www.domain.com/ [R=301,L]
但是,如果您仅针对某些页面重定向工作,请检查是否清除了浏览器缓存或使用其他缓存
Changing domain.com/mydomain/file.extention to domain.com/file.extention
use this for example
RewriteRule ^mydomain/(.+)$ http://www.domain.com/ [R=301,L]
But if you redirects working just for some pages check that you clear browser cache or use another one instead
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
您的问题有很多子问题: 如果你想“在任何文件夹中捕获这个.php文件,它可能会被查找”,那么只要您的.htaccess文件位于您网站的根文件夹中(而不是在子文件夹中),那么您就会受到保护。 如果要覆盖任何尾随字符,则可以对重写规则进行两处更改之一: 删除结尾$: RewriteRule (^|/)mpn_engine\.php /index.html? [L,NC,R=301] 要么 在“php”之后添加一个通配符: RewriteRule (^|/)mpn_engine\.php(.*)$ /index. ...
-
htaccess RewriteRule表示未知文件夹名称无法正常工作(htaccess RewriteRule for unknown folder name not working)[2023-08-30]
试试这条规则: RewriteCond %{REQUEST_URI} !^/newfolder/subfolder/ [NC] RewriteRule ^[^/]+/([^.]+)\.php(.*)$ /newfolder/subfolder/$1.php$2 [NC,L] Try this rule: RewriteCond %{REQUEST_URI} !^/newfolder/subfolder/ [NC] RewriteRule ^[^/]+/([^.]+)\.php(.*)$ /newfolde ... -
要为您的子域重写任何内容,您可以使用以下规则: RewriteEngine On RewriteRule ^(.*)$ httpdocs/web/$1 [L] ^$只会重写登录页面,而.*会匹配所有URI。 To rewrite anything for your subdomain you can use this rule: RewriteEngine On RewriteRule ^(.*)$ httpdocs/web/$1 [L] ^$ will only rewrite landing p ...
-
# If the URI is not .htm and doesn't have any additonal params, try .htm RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(?![^/]+\.htm)([^/]+)$ $1.htm [L,R=302] # Adding the R flag causes the URI to be rewritten in the ...
-
使用RewriteRule在.htaccess文件中隐藏URI中的文件夹(Hide a folder from the URI with RewriteRule in a .htaccess file)[2022-01-14]
将domain.com/mydomain/file.extention更改为domain.com/file.extention 以此为例 RewriteRule ^mydomain/(.+)$ http://www.domain.com/ [R=301,L] 但是,如果您仅针对某些页面重定向工作,请检查是否清除了浏览器缓存或使用其他缓存 Changing domain.com/mydomain/file.extention to domain.com/file.extention use this for ... -
您可以使用: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/sites/$1\.php -f [NC] RewriteRule ^(.+?)/?$ /sites/$1.php [L] You can use: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/sites/$ ...
-
您可以尝试以下规则: RewriteRule ^((?!more-info)[^.]*)$ index.cgi/$1 [L,NC] You can try this rule: RewriteRule ^((?!more-info)[^.]*)$ index.cgi/$1 [L,NC]
-
尝试: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / # PHP to NO Extension RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule ^(.*)$ $1\.php #catch all products RewriteCond %{REQUEST_FILENAME} ...
-
您可以在.htaccess中使用此规则来获取所需的网址。 RewriteRule ^public/(.*)$ public?q=$1 [L,QSA] 更新1: RewriteEngine on RewriteCond %{HTTP_HOST} ^subdomain.domain.com RewriteRule ^public/(.*)$ http://subdomain.domain.com/comingsoon/public?q=$1 [L,NC,QSA] You can use this rule ...