How to read multiple csv files into one data frame using azure synapse notebooks


Hi Team,

Could you please help us on how to read multiples files of csv from different subfolders into a single data frame using azure synapse note book using pyspark.


Need to read above files in azure synapse notebooks, please share your thoughts on it.

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.
4,316 questions
{count} votes

1 answer

Sort by: Most helpful
  1. BhargavaGunnam-MSFT 25,796 Reputation points Microsoft Employee

    Hello SaiSekhar, MahasivaRavi (Philadelphia),

    Read multiple csv files using pyspark is discussed here:

    You can try the below code and let me know

    `from pyspark.sql.functions import *

    Define the file paths

    file_paths = ['abfss://', 'abfss:/', 'abfss:/']

    Read the CSV files into a single DataFrame

    df ="csv")
    .option("header", "true")
    .option("inferSchema", "true")

    Show the DataFrame `

    0 comments No comments