When copying a table from snowflake using the snowflake spark connector, the default behavior is to map structured data to spark strings: https://docs.snowflake.net/manuals/user-guide/spark-connector-use.html#from-snowflake-to-spark-sql
For example, given a table in snowflake:
create table schema.table as
select
array_construct('1','a') as array_col,
object_construct('1','a') as obj_col
And copying this in pyspark
df = snowflake.sql_context.read.format("snowflake url")\
.options(**snowflake_options)\
.load()
results in the dataframe:
> df: pyspark.sql.dataframe.DataFrame
> ARRAY_COL:string
> OBJ_COL:string
Is there currently a way to override this default behavior within the connector to map snowflake OBJECT
to spark StructType
and/or snowflake ARRAY
to spark MapType
?