Skip to content

Commit 8a868b7

Browse files
committed
[hcat] Adding queries
1 parent 0f81131 commit 8a868b7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

hcatalog/avg_salary.hql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SELECT AVG(salary) FROM sample_07;
2+

hcatalog/avg_salary.pig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Load table 'sample_07'
2+
sample_07 = LOAD 'sample_07' USING org.apache.hcatalog.pig.HCatLoader();
3+
4+
-- Compute the average salary of the table
5+
salaries = GROUP sample_07 ALL;
6+
out = FOREACH salaries GENERATE AVG(sample_07.salary);
7+
DUMP out;
8+

0 commit comments

Comments
 (0)