@@ -196,6 +196,7 @@ def get_creation_expression(
196196 explicit_metadata_path = "" ,
197197 storage_type_as_arg = False ,
198198 storage_type_in_named_collection = False ,
199+ cluster_name_as_literal = True ,
199200 additional_settings = [],
200201 ** kwargs ,
201202):
@@ -224,6 +225,8 @@ def get_creation_expression(
224225 else :
225226 settings_expression = ""
226227
228+ cluster_name = "'cluster_simple'" if cluster_name_as_literal else "cluster_simple"
229+
227230 storage_arg = storage_type
228231 engine_part = ""
229232 if (storage_type_in_named_collection ):
@@ -252,7 +255,7 @@ def get_creation_expression(
252255
253256 if run_on_cluster :
254257 assert table_function
255- return f"iceberg{ engine_part } Cluster('cluster_simple' , { storage_arg } , filename = 'iceberg_data/default/{ table_name } /', format={ format } , url = 'http://minio1:9001/{ bucket } /')"
258+ return f"iceberg{ engine_part } Cluster({ cluster_name } , { storage_arg } , filename = 'iceberg_data/default/{ table_name } /', format={ format } , url = 'http://minio1:9001/{ bucket } /')"
256259 else :
257260 if table_function :
258261 return f"iceberg{ engine_part } ({ storage_arg } , filename = 'iceberg_data/default/{ table_name } /', format={ format } , url = 'http://minio1:9001/{ bucket } /')"
@@ -271,7 +274,7 @@ def get_creation_expression(
271274 if run_on_cluster :
272275 assert table_function
273276 return f"""
274- iceberg{ engine_part } Cluster('cluster_simple' , { storage_arg } , container = '{ cluster .azure_container_name } ', storage_account_url = '{ cluster .env_variables ["AZURITE_STORAGE_ACCOUNT_URL" ]} ', blob_path = '/iceberg_data/default/{ table_name } /', format={ format } )
277+ iceberg{ engine_part } Cluster({ cluster_name } , { storage_arg } , container = '{ cluster .azure_container_name } ', storage_account_url = '{ cluster .env_variables ["AZURITE_STORAGE_ACCOUNT_URL" ]} ', blob_path = '/iceberg_data/default/{ table_name } /', format={ format } )
275278 """
276279 else :
277280 if table_function :
@@ -293,7 +296,7 @@ def get_creation_expression(
293296 if run_on_cluster :
294297 assert table_function
295298 return f"""
296- iceberg{ engine_part } Cluster('cluster_simple' , { storage_arg } , path = '/iceberg_data/default/{ table_name } /', format={ format } )
299+ iceberg{ engine_part } Cluster({ cluster_name } , { storage_arg } , path = '/iceberg_data/default/{ table_name } /', format={ format } )
297300 """
298301 else :
299302 if table_function :
0 commit comments