Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

What is the difference between Union ALL and Union in spark sql

Highlighted

What is the difference between Union ALL and Union in spark sql

New Contributor
 
1 REPLY 1
Highlighted

Re: What is the difference between Union ALL and Union in spark sql

New Contributor

In general, in SQL, it means: 

 

UNION ALL - Include Duplicates  

UNION - distinct values

 

Ex:

 A = { 1,2,3,4,5}

B = {4,5,6,7}

 

A [UNION ALL] B = {1,2,3,4,5,4,5,6,7}

A [UNION] B = {1,2,3,4,5,6,7}

Don't have an account?
Coming from Hortonworks? Activate your account here