ploosh.
Documentation
Fabric Semantic Model Spark connector
This connector is used to query a Microsoft Fabric Semantic Model and return a Spark DataFrame.
Warning: a Spark connector can be used only with another Spark connector. It is not possible to use a Spark connector with a non-Spark connector.
See Spark documentation for more information.
Connection configuration
| Name | Mandatory | Default | Description |
|---|---|---|---|
| semanticmodelname | yes | Semantic model (dataset) name in Fabric | |
| workspace_name | no | null | Fabric workspace name. If omitted, default workspace context is used |
Configuration
Test case configuration
| Name | Mandatory | Default | Description |
|---|---|---|---|
| method | yes | Query method. Allowed values: DAX Query, Table, Measure | |
| daxquery | no | null | DAX query text. Used when method: DAX Query |
| tabletoquery | no | null | Table name to read. Used when method: Table |
| measuretoquery | no | null | Measure name to evaluate. Used when method: Measure |
| groupby | no | null | List of grouping columns for measure evaluation. Used when method: Measure |
| filterstoapply | no | null | Dictionary of filters for measure evaluation. Used when method: Measure |
| column_names | yes | List of output column names. List size must match returned column count |
Examples
Example Fabric Semantic Model DAX:
source:
type: fabricsemanticmodel_spark
connection: testfabricsemanticmodelspark
method: DAX Query
dax_query: |
EVALUATE SUMMARIZECOLUMNS(
'CountrySales'[Country],
'CountrySales'[Sales]
)
column_names:
- Country
- Sales
expected:
type: empty_spark
Example Fabric Semantic Model Measure:
source:
type: fabricsemanticmodel_spark
connection: testfabricsemanticmodelspark
method: Measure
measuretoquery: Sales with tax
group_by:
- "'CountrySales'[Country]"
filterstoapply:
{"'CountrySales'[Country]" : ["France", "Germany"]}
expected:
type: empty_spark
Example Fabric Semantic Model Table:
source:
type: fabricsemanticmodel_spark
connection: testfabricsemanticmodelspark
method: Table
tabletoquery: CountrySales
column_names:
- Country
- Sales
expected:
type: empty_spark