Reputation: 13
We are using python for data load so we need to create file format in snowflake using python. I have tried to creating file format through python but it got error out.
Could someone please share the sample python script for creating file format using python.
Upvotes: 0
Views: 488
Reputation: 1321
You can execute your file format DDL statement via Python cursor.
snowflake.connector as sfc
# --Snowflake Connection Setup
cnx = sfc.connect(
user='user',
password=pwd,
account='account',
warehouse = 'warehouse',
database='database',
schema='schema',
role = 'role')
cnx.cursor().execute("create or replace file format mycsvformat type = 'CSV'
field_delimiter '|' skip_header = 1;")
Upvotes: 0