Which Languages Support PREDICT Function in Fabric Notebook
Short answer
CD Use Spark SQL and PySpark to perform model scoring with the PREDICT function in a Fabric notebook.
Question
You need to use the model to generate predictions by using the PREDICT function in a Fabric notebook.
Which two languages can you use to perform model scoring? Each correct answer presents a complete solution.
NOTE: Each correct answer is worth one point.
Key Takeaways
The PREDICT function in a Fabric notebook is strictly supported by Spark SQL and PySpark, trapping users who mistakenly assume T-SQL or DAX can be used for Spark-based ML scoring.
Microsoft Fabric notebooks support the PREDICT function for machine learning model scoring using specific Spark-based languages. This page establishes that Spark SQL and PySpark are the correct options for generating predictions.
Common mistake: Choosing T-SQL because it is a prominent query language in Fabric, but it cannot be used in Spark notebooks for the PREDICT function.
Expert Analysis
Why the Answer Is Correct
The PREDICT function in a Microsoft Fabric notebook allows users to score registered machine learning models and generate predictions. According to official documentation, model scoring with PREDICT in a notebook is supported via the Spark SQL API and the PySpark user-defined function (UDF). These Spark-based languages are natively integrated with the underlying Spark compute of the notebook, enabling seamless batch scoring operations.
Why the Other Options Are Wrong
T-SQL is used in Fabric data warehouses and Lakehouse SQL analytics endpoints, not in Spark notebooks for ML model scoring. DAX is an analytical query language used exclusively for Power BI semantic models and has no capability to invoke machine learning models or the PREDICT function in a notebook environment.
Community Comment Notes
Community members strongly agree that notebooks only accept Spark-based languages for this task. As gtc108 pointed out by referencing the official documentation, you can invoke the PREDICT function using the "Spark SQL API PySpark user-defined function". Others, like mtroyano, noted that a "Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR", effectively ruling out T-SQL and DAX.
Official Reference
https://learn.microsoft.com/en-us/fabric/data-science/tutorial-data-science-batch-scoring
This link opens the official vendor documentation in a new tab.
Exam Strategy
When asked about notebook languages in Fabric, remember that notebooks run on Spark compute. Therefore, only Spark-based languages like PySpark and Spark SQL are valid for ML scoring, whereas T-SQL and DAX are reserved for warehouses and semantic models.
Discussion 18 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 18
-
dev2dev 👍 6that indicates to use spark sql language.
-
DarioReymago 👍 4yes but you can use "%%sql" in a notebook
-
gtc108 👍 3https://learn.microsoft.com/en-us/fabric/data-science/tutorial-data-science-batch-scoring ou'll load the test dataset into a spark DataFrame and create an MLFlowTransformer object to generate batch predictions. You can then invoke the PREDICT function using one of following three ways: Transformer API from SynapseML Spark SQL API PySpark user-defined function (UDF)
-
olavrab8 👍 3Answer CD Correct T-SQL Cannot be used, nor DAX
-
wojciech_wie 👍 2CD - https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
Show 13 more comments
-
NadeemSalam 👍 2It can be done using python which is only supported in sparksql and pyspark
-
Vulkany 👍 2Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
-
Momoanwar 👍 2C & d in notebook
-
stilferx 👍 1IMHO, the answer is C & D. Link is here: https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool Here, """You can call PREDICT three ways, using Spark SQL API, using User define function (UDF), and using Transformer API. """. That means, UDF = PySpark in our case.
-
semauni 👍 1The question asks to do this from a notebook. Spark SQL can be accessed from the notebook using the %%sql-command, while T-SQL cannot. Spark SQL, however, can also be used: https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
-
DarioReymago 👍 1We can use Predict function with T-SQL: https://learn.microsoft.com/en-us/sql/t-sql/queries/predict-transact-sql?view=sql-server-ver16 But I cannot found the Predict function in Spark SQL. Is different to run a predict process in PySpark
-
rmeng 👍 1https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
-
BrandonPerks 👍 1The mention of Fabric Notebook, gives the hint to using Spark. Thus I went with CD
-
mahesh chowtipalli 👍 1Because Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
-
testtaker45 👍 1Thank you for that. I had the same question DarioReymago had.
-
David_Webb 👍 1Using Fabric notebook, thus must be C and D.
-
NRezgui 👍 1PySpark, Spark
-
jass007_k 👍 1Its C and D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DP-600 Questions
Access 115 questions with complete answers and detailed explanations.
View Full DP-600 Practice Test →