Forum Discussion
Issue with Mirroring from Cosmos DB: Decimal Values Replicated as NULL in Fabric Mirroring
Hi everyone,
I’m running into an issue with Cosmos DB Mirroring in Microsoft Fabric, and I’d like to confirm whether others have experienced something similar, or if there are any alternative solutions or workarounds.
🧩 Scenario:
I have a Cosmos DB container (with Synapse Link / Analytical Store enabled) that is being mirrored into a Fabric warehouse using the built-in Mirroring feature.
The field "Total" is present in every document, and its values can be either integers (e.g., 6000) or floating-point numbers (e.g., 17.9, 15.1, 6000.0).
Mirroring appears to work fine in general. However, I've discovered that when querying the mirrored table via the SQL Endpoint, any "Total" value that was originally a decimal (like 17.9) shows up as NULL.
In contrast, values like 6000 or 6000.0 replicate correctly.
⚠️ Observed Behavior:
Example in Cosmos DB:
{ "id": "...", "Total": 17.9 }
→ In Fabric SQL Endpoint: Total = NULL
✅ What I’ve confirmed:
The "Total" field is always present and defined in the source documents.
This is not a case of missing data, but rather seems to be tied to how the schema is inferred or fixed during replication.
Microsoft documentation states that Analytical Store uses the first defined value to infer the schema, and that conflicting types (e.g., integer vs. float) may result in values being skipped or returned as NULL.
❓ What I'm looking for:
Has anyone else experienced this issue?
Are there best practices for handling numeric fields in Cosmos DB (especially when they can be int or float)?
Any known workarounds besides:
Forcing all values to be floats (e.g., 6000.0 instead of 6000)
Recreating the container with consistent types
Refreshing or recreating the mirroring after schema normalization
Thanks in advance for any suggestions or confirmations from the community!
- Anonymous1 year ago
Hi Rodrigol_SF,
Another workaroud is Instead of directly mirroring from the Analytical Store, route data through a Dataflow Gen2 or Spark notebook in Fabric to Ensure schema consistency before loading into a Warehouse or Lakehouse
Regards,
Vinay Pabbu
5 Replies
- AnonymousNot applicable
Hi Rodrigol_SF,
Thank you for reaching out to Microsoft Fabric Community Forum.
One thing you could try is adding a small pre-processing step in Cosmos DB to convert all 'Total' values to floats—so something like 6000 becomes 6000.0—before the data gets mirrored into Fabric. That helps keep the data type consistent
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu- Rodrigol_SFRegular Visitor
Hi Vinay!
Thanks for your feedback. I don't think the proposed solution is entirely appropriate for our scenario, but I'll let you know if we implement it.
Regards- AnonymousNot applicable
Hi Rodrigol_SF,
Another workaroud is Instead of directly mirroring from the Analytical Store, route data through a Dataflow Gen2 or Spark notebook in Fabric to Ensure schema consistency before loading into a Warehouse or Lakehouse
Regards,
Vinay Pabbu
- AnonymousNot applicable
Hi Rodrigol_SF,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.Regards,
Vinay Pabbu