Created
December 15, 2016 11:38
-
-
Save myui/2b00086110776c1ac9f925900c257a12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH term_frequency as ( | |
select | |
docid, | |
word, | |
freq | |
from ( | |
select | |
docid, | |
tf(word) as word2freq | |
from | |
page_exploded | |
group by | |
docid | |
) t | |
LATERAL VIEW explode(word2freq) t2 as word, freq | |
), | |
document_frequency as ( | |
select | |
word, | |
count(distinct docid) docs | |
from | |
page_exploded | |
group by | |
word | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment