I have a question about Snowflake's new capability -Infer Schema table function. The INFER SCHEMA function performs admirably on the parquet file and returns the correct data type. However, when the parquet files are partitioned and stored in S3, the INFER SCHEMA does not function as it does with pyspark dataframes.
In DataFrames, the partition folder name and value are read as the last column; is there a way to achieve the same result in the Snowflake Infer schema?
Example:
@GregPavlik - The input is in structured parquet format. When the parquet files are stored in S3 without a partition, the schema is perfectly derived.
Example : { "AGMT_GID": 1714844883, "AGMT_TRANS_GID": 640481290, "DT_RECEIVED": "20 302", "LATEST_TRANSACTION_CODE": "I" }
The Snowflake infer schema provides me with 4 column names as well as their data types.
However if the parquet file is stored in partition - like shown in image above.
under - LATEST_TRANSACTION_CODE =I/ folder i would have the file as
Example : { "AGMT_GID": 1714844883, "AGMT_TRANS_GID": 640481290, "DT_RECEIVED": "20 302" }
In this case, snowflake infer Schema only provides three columns; however, reading the same file in Pyspark dataframe prints all four columns.
I'm wondering if there is a workaround in Snowflake to read a partitioned parquet file.
