Write
org.apache.spark.sql.Dataframe.write => com.snowflake.snowpark.Dataframe.write
Write transformation consists on replace equivalent methods. Also, transformations add EWIs to not supported methods and also for unsupported or not required options.
Methods supported by Snowpark are: async, mode, option, saveAsTable.
Options supported by Snowpark are: dbtable, which value is used as a parameter to the saveAsTable method.
Input Code:
df.write.
format("net.snowflake.spark.snowflake").
option("sfUrl", s"https://$ACCOUNT.snowflakecomputing.com:443").
option("sfAccount", ACCOUNT).
option("sfUser", USER).
option("sfPassword", PASSWORD).
option("sfSchema", SCHEMA).
option("sfDatabase", DB).
option("sfWarehouse", WAREHOUSE).
option("sfRole", ROLE).
option("truncate_table", "ON").
option("usestagingtable", "OFF").
option("dbtable", tablename).mode("overwrite").save()Output Code:
Last updated
Was this helpful?