- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Not yet supported place for UDAF 'count' on Tutorial Exercise 2
- Labels:
-
Apache Hive
Created on ‎02-15-2016 05:59 PM - edited ‎09-16-2022 03:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
on the Tutorial Exercise 2 the next query not works when the line "order by count(*);" is included
(on Hive Editor and cloudera-quickstart-vm-5.5.0-0-vmware)
select count(*), url from tokenized_access_logs
where url like '%\/product\/%'
group by url
order by count(*);
the error showed is:
Error while compiling statement: FAILED: SemanticException [Error 10128]: Line 4:9 Not yet supported place for UDAF 'count'
Created ‎02-26-2016 08:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for reporting this. You are right, the query fails with that error message, the correct query should be like:
select count(*) as cnt, url from tokenized_access_logs
where url like '%\/product\/%'
group by url
order by cnt desc;
I will file this to be corrected in the tutorial.
Thanks again and cheers,
Miklos
Miklos Szurap
Customer Operations Engineer, Cloudera
Created ‎03-01-2016 11:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That part of the tutorial has you use the Impala query editor - the query should work in Impala's particular flavor of the query language.
Created ‎05-09-2017 03:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the perfect query will use replace function to remove '%' in the url
select count(*) as cnt,regexp_replace(url,'%','') as urlt
from tokenized_access_logs
where url like '%\/product\/%'
group by url
order by cnt desc;
Created ‎05-09-2017 03:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
select count(*) as cnt,regexp_replace(url,'%','') as urlt
from tokenized_access_logs
where url like '%\/product\/%'
group by url
order by cnt desc;
