SQL Combine

Combines two DataFrames using Spark SQL expression provided by the user on a DataFrames connected to its input ports. Returns the results of the execution as a DataFrame.

Since: Seahorse 1.4.0

Input

Port Type Qualifier Description
0 DataFrame The left-hand side DataFrame.
1 DataFrame The right-hand side DataFrame.

Output

Port Type Qualifier Description
0 DataFrame The DataFrame containing a result of executing the expression.

Parameters

Name Type Description
Left dataframe id String The identifier that can be used in the Spark SQL expression to refer the left-hand side DataFrame.
Right dataframe id String The identifier that can be used in the Spark SQL expression to refer the right-hand side DataFrame.
expression Code Snippet The Spark SQL expression to be executed. The expression must be a valid Spark SQL expression.

Example

Parameters

Name Value
Left dataframe id "beds"
Right dataframe id "prices"
expression
SELECT DISTINCT beds.city, beds.beds
FROM beds
JOIN prices ON beds.city = prices.city
AND prices.price < 120000 * beds.beds
        

Input

Input 0

city beds
CityA 4.0
CityC 2.0
CityB 3.0

Input 1

city price
CityA 695611.0
CityC 294691.0
CityB 430784.0
CityB 336677.0
CityA 584639.0
CityA 579560.0

Output

city beds
CityB 3.0