snowflake.snowpark.DataFrame.natural_join¶
- DataFrame.natural_join(right: DataFrame, how: Optional[str] = None, **kwargs) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.23.0/src/snowflake/snowpark/dataframe.py#L2117-L2178)¶
- Performs a natural join of the specified type ( - how) with the current DataFrame and another DataFrame (- right).- Parameters:
- right – The other - DataFrameto join.
- how – - We support the following join types: - Inner join: “inner” (the default value) 
- Left outer join: “left”, “leftouter” 
- Right outer join: “right”, “rightouter” 
- Full outer join: “full”, “outer”, “fullouter” 
 - You can also use - join_typekeyword to specify this condition. Note that to avoid breaking changes, currently when- join_typeis specified, it overrides- how.
 
 - Examples::
- >>> df1 = session.create_dataframe([[1, 2], [3, 4], [5, 6]], schema=["a", "b"]) >>> df2 = session.create_dataframe([[1, 7], [3, 8]], schema=["a", "c"]) >>> df1.natural_join(df2).show() ------------------- |"A" |"B" |"C" | ------------------- |1 |2 |7 | |3 |4 |8 | ------------------- - >>> df1 = session.create_dataframe([[1, 2], [3, 4], [5, 6]], schema=["a", "b"]) >>> df2 = session.create_dataframe([[1, 7], [3, 8]], schema=["a", "c"]) >>> df1.natural_join(df2, "left").show() -------------------- |"A" |"B" |"C" | -------------------- |1 |2 |7 | |3 |4 |8 | |5 |6 |NULL | --------------------