Azure / Azure/Azurite

[Table Storage] Azurite does not return properties with null values when querying with $select operator

Open
#2,535 1 comment 0 reactions 1 assignee Claimed by @EmmaZhu View on GitHub
alignment table-query table-storage
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

There is an inconsistency in the way Azurite serves queries that include inexistent properties. Azure Table Storage returns properties with null values, while Azurite does not include them in the payload.

Add entity:
```
[Informational] Azure-Core: Request [0422bb54-dd29-42ea-ab0b-9ba9061f7ae3] POST http://127.0.0.1:10002/devstoreaccount1/TableName?$format=REDACTED
[Verbose] Azure-Core: Request [0422bb54-dd29-42ea-ab0b-9ba9061f7ae3] content: {"PartitionKey":"PK","RowKey":"RK","NonNullProperty":"something"}
```

Get entity requesting the inexsistent property:
```
[Informational] Azure-Core: Request [a12af699-92e1-49d3-ac1a-548547f6ba53] GET http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey='PK',RowKey='RK')?$format=REDACTED&$select=NonNullProperty%2CInexistentProperty
User-Agent:azsdk-net-Data.Tables/12.8.3 (.NET 8.0.13; Microsoft Windows 10.0.22631)
Server:Azurite-Table/3.32.0
[Verbose] Azure-Core: Response [a12af699-92e1-49d3-ac1a-548547f6ba53] content: {"odata.metadata":"http://127.0.0.1:10002/devstoreaccount1/$metadata#TableName/@Element","odata.etag":"W/\"datetime'2025-02-28T06%3A54%3A16.4431620Z'\"","NonNullProperty":"something"}
```

That's what it looks like for Azure Table Storage:

Add entity:
```
[Informational] Azure-Core: Request [a1675057-f3d6-4f74-99be-d58a22ffd6f3] POST https://.table.core.windows.net/TableName?$format=REDACTED
User-Agent:azsdk-net-Data.Tables/12.8.3 (.NET 8.0.13; Microsoft Windows 10.0.22631)
[Verbose] Azure-Core: Request [a1675057-f3d6-4f74-99be-d58a22ffd6f3] content: {"PartitionKey":"PK","RowKey":"RK","NonNullProperty":"something"}
Server:Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
```

Get entity requesting the inexsistent property:
```
[Informational] Azure-Core: Request [4e03764e-a8bd-4d3a-b762-1201272ed224] GET https://.table.core.windows.net/TableName(PartitionKey='PK',RowKey='RK')?$format=REDACTED&$select=NonNullProperty%2CInexistentProperty
User-Agent:azsdk-net-Data.Tables/12.8.3 (.NET 8.0.13; Microsoft Windows 10.0.22631)
[Informational] Azure-Core: Response [4e03764e-a8bd-4d3a-b762-1201272ed224] 200 OK (00.1s)
Server:Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
[Verbose] Azure-Core: Response [4e03764e-a8bd-4d3a-b762-1201272ed224] content: {"odata.metadata":"https://.table.core.windows.net/$metadata#TableName/@Element&$select=NonNullProperty,InexistentProperty","odata.etag":"W/\"datetime'2025-02-28T07%3A00%3A37.4437045Z'\"","InexistentProperty":null,"NonNullProperty":"something"}
```
To be honest, I would prefer if Table Storage behaved like Azurite :) In my scenario, I query for ~20 properties while only a few will have values. It means that the responses are unnecessarily large. If there is a way to tell Azure Table Storage to skip null properties, it would be much appreciated!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.