Microsoft Fabric Data Engineer Associate DP-700 Practice Question
In a Microsoft Fabric notebook, you ingest a CSV file into a PySpark DataFrame named df by running a Python cell. In the next cell you switch the language to SQL by adding %%sql at the top and enter
SELECT * FROM df;
When the notebook runs in a pipeline, the SQL cell fails with the message "AnalysisException: Table or view not found: df". You need to correct the notebook so that the SQL cell can access the data without rewriting the query in Python. What should you do?
Restart the notebook session to ensure the spark variable is re-initialized and rerun all cells.
Change the language of the failing cell from %%sql to %%pyspark so the query runs in Python instead of SQL.
Increase the spark.sql.shuffle.partitions setting to improve query parallelism before rerunning the pipeline.
Add a PySpark cell before the SQL cell that executes df.createOrReplaceTempView("df"), then rerun the notebook.
In Fabric notebooks, each cell can run in a different language, but variables defined in one language are not automatically visible to another. To expose a PySpark DataFrame to SQL cells, you must register the DataFrame as a temporary view. Running df.createOrReplaceTempView("df") in a PySpark cell publishes the DataFrame under the name df in the Spark catalog, allowing subsequent %%sql cells to query it with standard SQL syntax. Simply switching the SQL cell back to Python, restarting the session, or changing Spark configuration does not make the DataFrame available to SQL; they either avoid SQL entirely or do not address the visibility issue.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a temporary view in Spark, and why is it needed in this scenario?
Open an interactive chat with Bash
Why do different cells in a Fabric notebook not share variables across languages?
Open an interactive chat with Bash
What are some alternative ways to share data between PySpark and SQL in a notebook?
Open an interactive chat with Bash
Microsoft Fabric Data Engineer Associate DP-700
Monitor and optimize an analytics solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .