DP-300 · Question #95
You have an Azure Synapse Analytics Apache Spark pool named Pool1. You plan to load JSON files from an Azure Data Lake Storage Gen2 container into the tables in Pool1. The structure and data types…
The correct answer is A. Load the data by using PySpark. Synapse notebooks support four Apache Spark languages: PySpark (Python) Note: Bring data to a notebook. You can load data from Azure Blob Storage, Azure Data Lake Store Gen 2, and SQL pool as shown in the code samples below. Read a CSV from Azure Data Lake Store Gen2 as a Spark…
Question
Options
- ALoad the data by using PySpark.
- BLoad the data by using the OPENROWSET Transact-SQL command in an Azure Synapse
- CUse a Get Metadata activity in Azure Data Factory.
- DUse a Conditional Split transformation in an Azure Synapse data flow.
How the community answered
(48 responses)- A75% (36)
- B6% (3)
- C4% (2)
- D15% (7)
Explanation
Synapse notebooks support four Apache Spark languages: PySpark (Python) Note: Bring data to a notebook. You can load data from Azure Blob Storage, Azure Data Lake Store Gen 2, and SQL pool as shown in the code samples below. Read a CSV from Azure Data Lake Store Gen2 as a Spark DataFrame. from pyspark.sql import SparkSession from pyspark.sql.types import * account_name = "Your account name" container_name = "Your container name" relative_path = "Your path" adls_path = 'abfss://%s@%s.dfs.core.windows.net/%s' % (container_name, account_name, relative_path) df1 = spark.read.option('header', 'true') \ .option('delimiter', ',') \ .csv(adls_path + '/Testfile.csv') https://docs.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-development-
Topics
Community Discussion
No community discussion yet for this question.