File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
sqlmesh/core/engine_adapter Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,10 @@ def merge(
9393 df = self .try_get_df (source_table )
9494 if self ._use_spark_session and df is not None :
9595 pyspark_df = self ._ensure_pyspark_df (df )
96- temp_view_name = self ._get_temp_table (target_table , table_only = True ).sql (
97- dialect = self .dialect
98- )
99- pyspark_df .createOrReplaceTempView (temp_view_name )
100- query = exp .select (* column_names ).from_ (temp_view_name )
96+ temp_view = self ._get_temp_table (target_table , table_only = True )
97+ pyspark_df .createOrReplaceGlobalTempView (temp_view .sql (dialect = self .dialect ))
98+ temp_view .set ("db" , "global_temp" )
99+ query = exp .select (* column_names ).from_ (temp_view .sql (dialect = self .dialect ))
101100 super ().merge (target_table , query , columns_to_types , unique_key )
102101 else :
103102 super ().merge (target_table , source_table , columns_to_types , unique_key )
You can’t perform that action at this time.
0 commit comments