Model Scoring Languages in Fabric Notebook

DP-600 By islever Editorial Last updated

Short answer

CD Spark SQL and PySpark are the two languages that allow you to perform model scoring using the PREDICT function in a Fabric notebook.

Question

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

Key Takeaways

This question tests knowledge of supported runtime environments within Fabric Notebooks for machine learning tasks, specifically distinguishing between T-SQL/DAX and Spark-based languages.

In Microsoft Fabric, you can use PySpark and Spark SQL to generate predictions using the PREDICT function. These languages support the necessary DataFrame and Transformer APIs for model scoring.

Common mistake: Candidates often select T-SQL because it supports a PREDICT clause in Azure SQL Database, but this is not available or relevant for the batch scoring context described in Fabric Notebooks using MLFlow/Spark pools.

Expert Analysis

Why the Answer Is Correct

The correct answers are C (Spark SQL) and D (PySpark). In Microsoft Fabric, machine learning workloads are executed within the OneLake/Spark engine. To perform batch scoring using the PREDICT function, you must interact with the data via Spark DataFrames. This can be done using PySpark (Python API), Spark SQL (SQL syntax on DataFrames), or through SynapseML Transformers. Both PySpark and Spark SQL provide the necessary interface to load datasets, apply ML models (often via MLFlow), and generate predictions.

Why the Other Options Are Wrong

T-SQL (Option A) is used for relational database operations in Azure SQL or Synapse Dedicated SQL Pools. While T-SQL has a PREDICT statement for server-side scoring, it operates on tables/views within the SQL engine, not within a Fabric Notebook's Spark execution context. DAX (Option B) is a formula language used primarily in Power BI and Analysis Services for data analysis and visualization, not for executing machine learning inference code in notebooks.

Community Comment Notes

Community consensus strongly favors CD, citing official Microsoft documentation that lists PySpark, Spark SQL, and SparkR as valid options for notebook-based scoring. Users reference tutorials showing how to load test datasets into Spark DataFrames and create MLFlowTransformers. Some users initially considered T-SQL due to its existence in other Microsoft products but confirmed it is incorrect for this specific notebook scenario.

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

Always identify the execution environment first. If the task involves 'Notebooks' and 'Machine Learning' in Fabric, think Spark (PySpark/Spark SQL). If it involves 'Dashboards' or 'Reports', think DAX. If it involves 'Relational Tables' and 'SQL Queries', think T-SQL.

Frequently Asked Questions

Why can't I use T-SQL for model scoring in Fabric Notebooks?

T-SQL runs in the SQL Pool engine, whereas Fabric Notebooks run in the Spark pool. The PREDICT function in this context refers to Spark-based ML inference, not SQL Server's predictive analytics.

Is R supported for model scoring in Fabric Notebooks?

Yes, SparkR is listed as a supported language alongside PySpark and Spark SQL. However, PySpark is generally preferred due to better ecosystem integration with libraries like MLflow and scikit-learn.

More DP-600 FAQ →

Community Votes

CD
100%

100% of anonymous learners picked answer CD. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 13 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, not of islever. The comments shown first are the most substantive of the thread — ranked by depth, community endorsement and relevance; expand the list below to read the rest.

From public community threads 13

  1. mtroyano 👍 18
    Notebook only accepts the languages: PySpark, Spark, Spark SQL and SparkR
  2. olavrab8 👍 3
    Answer CD Correct T-SQL Cannot be used, nor DAX
  3. gtc108 👍 2
    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)
  4. wojciech_wie 👍 2
    CD - https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
  5. stilferx 👍 1
    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.
Show 8 more comments
  1. DarioReymago 👍 1
    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
  2. rmeng 👍 1
    https://learn.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-score-model-predict-spark-pool
  3. BrandonPerks 👍 1
    The mention of Fabric Notebook, gives the hint to using Spark. Thus I went with CD
  4. David_Webb 👍 1
    Using Fabric notebook, thus must be C and D.
  5. Momoanwar 👍 2
    C & d in notebook
  6. Rakesh16 👍 1
    Spark SQL and PySpark
  7. NRezgui 👍 1
    PySpark, Spark
  8. jass007_k 👍 1
    Its C and D

Reader comments & corrections

No reader corrections 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.

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