Hello @Martin Smith
Please know that currently the Workspace DB option in Synapse data flow source transformation does not support specifying a query to run against a workspace DB table. It only has an option to select the whole table. As you mentioned, the documentation implies that the workspace DB option is just doing something that we can do ourselves with linked services.
In this case, you can use a linked service to connect to the Cosmos analytical store instance and then use a source transformation to read data from the linked service.
To do this, you can create a linked service of type "Azure Cosmos DB (SQL API)" and provide the necessary connection details. Then, in the data flow source transformation, you can select the linked service as the source and specify the query to filter the data.
Here is an example of how to create a linked service for Cosmos analytical store instance:
{
"name": "my_cosmosdb_linked_service",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"type": "AzureCosmosDB",
"typeProperties": {
"connectionString": "AccountEndpoint=;AccountKey=;Database=;"
}
}
}
Once you have created the linked service, you can use it in the data flow source transformation and specify the query to filter the data. For example:
source(output( col1 as string, col2 as string, col3 as string ),
allowSchemaDrift: true,
validateSchema: false,
ignoreNoFilesFound: false,
partitionOption: 'None',
query: 'SELECT * FROM c WHERE c._ts > 1234567890', format: 'json',
options: map( 'connectionString', 'my_cosmosdb_linked_service' )
)
I hope this helps.