My requirement is to take tabular data in Snowflake and save it as a csv file to Snowflake External Stage, where data has header and footer.
Is this doable using Snowpark(Python)? Result should look something like below where col1, col2, col3 are columns in Snowflake table
Australia Sales as at 2023-8-31. Version is 2021.01
Output_Format, CSV
NUMLINES, 6781
---------------------------------
col1, col2, col3
xxx,yyy,zzz
.....
xxx,yyy,zzz
---------------------------------
##END##
##COLOR####ENDCOLOR##
##FORMULA####ENDFORMULA##
This is possible with Snowpark Python API
DataFrameWriter.copy_into_locationas documented hereHere is an example: