Skip to content

Commit a768b37

Browse files
authored
Update analytical-store-introduction.md
1 parent 1378968 commit a768b37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

articles/cosmos-db/analytical-store-introduction.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ There are two types of schema representation in the analytical store. These type
228228

229229
The well-defined schema representation creates a simple tabular representation of the schema-agnostic data in the transactional store. The well-defined schema representation has the following considerations:
230230

231-
* The first document defines the base schema and property must always have the same type across all documents. The only exceptions are:
231+
* The first document defines the base schema and properties must always have the same type across all documents. The only exceptions are:
232232
* From `NULL` to any other data type. The first non-null occurrence defines the column data type. Any document not following the first non-null datatype won't be represented in analytical store.
233233
* From `float` to `integer`. All documents will be represented in analytical store.
234234
* From `integer` to `float`. All documents will be represented in analytical store. However, to read this data with Azure Synapse SQL serverless pools, you must use a WITH clause to convert the column to `varchar`. And after this initial conversion, it's possible to convert it again to a number. Please check the example below, where **num** initial value was an integer and the second one was a float.
@@ -271,6 +271,12 @@ WITH (num varchar(100)) AS [IntToFloat]
271271
* Spark pools in Azure Synapse will represent these columns as `undefined`.
272272
* SQL serverless pools in Azure Synapse will represent these columns as `NULL`.
273273

274+
##### What to do if have representation challenges
275+
276+
Currently the base schema can't be reset and It is possible that an old document with an incorrect schema was used to create that base schema. To delete or update the problematic documents won't help. The possible solutions are:
277+
278+
* To migrate the data to a new container, making sure that all documents have the correct schema.
279+
* To abandon the property with the wrong schema and add a new one, with another name, that has the correct datatypes. Example: You have billions of documents in the **Orders** container where the **status** property is a string. But the first document in that container has **status** defined with integer. So, one document will have **status** correctly represented and all other documents will have **NULL**. You can add the **status2** property to all documents and start to use it, instead of the original property.
274280

275281
#### Full fidelity schema representation
276282

0 commit comments

Comments
 (0)