I am new to snowflake. I'm writing a spark df to snowflake, using this code.
var = dict(sfUrl="xxxxxxxxxxxx",
sfUser=user,
sfPassword=password,
sfDatabase="xxxx",
sfSchema="xxx",
sfWarehouse="xxxx")
df.write.format("snowflake").mode("overwrite").options(**var).option("dbtable", "xxx").save()
The df has a few StringType() columns and when I check de data types in snowflake they have VARCHAR(16777216) type. It's crazy because their length must be 2. Is there any way to specify the varchar length when I write the data?
In this reference it mentions:
If length is specified, VARCHAR(N); otherwise, VARCHAR
But how can I specified length in the write command?
Thanks!