-
-
Save mioalter/175c6a71c8754212c73d to your computer and use it in GitHub Desktop.
This file contains 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
SELECT b, SUM(prob_inner * prob) AS prob | |
FROM distA LATERAL VIEW EXPLODE(g(a)) t AS b, prob_inner | |
GROUP BY b | |
-- where distA is Dist[A] as a table with columns a: A, prob: Double, and we think of g : A => Dist[B] as a UDTF which emits | |
-- multiple rows for each value a : A. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment