An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
Hi Debbie Edwards,
Thank you for posting query in Microsoft Q&A Platform.
We can use
withColumnfunction to add extra columns to dataframe. In this case usingwithColumnfunction we can add file and folder details to dataframe.
Kindly check below sample code.
%%pyspark
df = spark.read.load('abfss://rawdata@***************.dfs.core.windows.net/2021-2022/file.csv', format='csv'
## If header exists uncomment line below
, header=True
)
df.withColumn('folder', lit('myFolder'))
df.withColumn('file', lit('myFile'))
display(df.limit(10))
You can consider checking below video to understand about withColumn function.
Hope this helps. Please let me know if any further queries.
Please consider hitting Accept Answer button. Accepted answers help community as well.