Need help in finding Spark SQL code equivalent to SAS Code

58 Views Asked by At

I have a piece of code which I need to convert from SAS to Spark SQL. I want to know what is the equivalent function for as that in SAS

SAS Code:

DATA NEW_TABLE;
SET
SOURCE_TABLE1
SOURCE_TABLE2
;
RUN;

I do understand that it's creating a new table by joining the existing two source tables. But not able to understand how that converts to SQL

1

There are 1 best solutions below

0
Chris J On

In standard SQL syntax, that would be a UNION or UNION ALL.

create table new_table as
select * from source_table1
union
select * from source_table2

The above assumes that the columns in both source tables are identical.