Which Languages Support PREDICT Function in Fabric Notebook

Answer Correct answer: C, D — Use Spark SQL and PySpark to perform model scoring with the PREDICT function in a Fabric notebook.

You have a Fabric tenant that contains a machine learning model registered in a Fabric workspace. 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.

  1. T-SQL
  2. DAX
  3. Spark SQL Correct Answer
  4. PySpark Correct Answer

Community Insight

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.

Choosing T-SQL because it is a prominent query language in Fabric, but it cannot be used in Spark notebooks for the PREDICT function.

Community Discussion (21 comments)

mahesh chowtipalli 👍 1 Selected: CD
Because Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
NadeemSalam 👍 2 Selected: CD
It can be done using python which is only supported in sparksql and pyspark
Vulkany 👍 2 Selected: CD
Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
NRezgui 👍 1 Selected: CD
PySpark, Spark
shorymor 👍 2 Selected: CD
Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
jass007_k 👍 1
Its C and D
testtaker45 👍 1
Thank you for that. I had the same question DarioReymago had.
gtc108 👍 3
https://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)
Gab13 👍 2 Selected: CD
Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
dev2dev 👍 6
that indicates to use spark sql language.
DarioReymago 👍 1 Selected: AD
We 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
semauni 👍 1
The 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
stilferx 👍 1 Selected: CD
IMHO, 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.
rmeng 👍 1 Selected: CD
https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
mtroyano 👍 19 Selected: CD
Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
DarioReymago 👍 4
yes but you can use "%%sql" in a notebook
David_Webb 👍 1 Selected: CD
Using Fabric notebook, thus must be C and D.
BrandonPerks 👍 1
The mention of Fabric Notebook, gives the hint to using Spark. Thus I went with CD
Momoanwar 👍 2 Selected: CD
C & d in notebook
wojciech_wie 👍 2
CD - https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
olavrab8 👍 3 Selected: CD
Answer CD Correct T-SQL Cannot be used, nor DAX

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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

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.

Related Analysis

Practice All DP-600 Questions

Access 115 questions with complete answers and detailed explanations.

View Full DP-600 Practice Test →

← Back to DP-600 Study Guide