0

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.

Sriga
  • 1,165
  • 4
  • 11

1 Answers1

0

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;")
Dharman
  • 30,962
  • 25
  • 85
  • 135
Sriga
  • 1,165
  • 4
  • 11