schema inference in Synapse Analytics

Rohit Kulkarni 731 Reputation points
2021-06-02T17:41:58.627+00:00

Hello Team,

What is meant by schema inference.And please explain me with example.But i am not able to find the proper example for this schema inference.

Please advise

Thanks in advance

RK

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,309 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,601 Reputation points
    2021-06-03T10:48:49.037+00:00

    Hello @Rohit Kulkarni ,

    Thanks for the question and using MS Q&A platform.

    What is schema inference?

    Infer schema will automatically guess the data types for each field.

    In Azure Synapse Analytics, schema inference works only for parquet format.

    102030-image.png

    For other formats:

    Infer schema will automatically guess the data types for each field. If we set this option to TRUE, the API will read some sample records from the file to infer the schema.

    To example, in more details I had create two dataframe one with inferschema=’False’ and another inferschema=’True’ with a sample data.

    102038-image.png

    • df_without_schema without inferschema (If you look at the schema of the dataframe, every data type is treated as string).
    • df_with_schema with inferschema=‘True’ (If you look at the schema of the dataframe, it automatically detected the data types).

    102092-image.png

    Hope this helps. Do let us know if you any further queries.

    ---------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.