Description
openedon Feb 24, 2022
- Package Name: @azure/data-tables
- Package Version: 3.0.1-alpha.20220112.3
- Operating system: Windows 11
- nodejs
- version: 16.3.1
- browser
- name/version:
- typescript
- version: 4.5.3
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
There is an inconsistency in how binary values are represented in listEntity
results and query strings. listEntity
results appear to use Base64 encoded values, but such values are considered invalid when used in a query string.
To Reproduce
- Run the following code snippet:
const client = TableClient.fromConnectionString("<CONNECTION_STRING>", "<TABLE>", { disableTypeConversion: true }); // Insert the value "Hello!" await client.createEntity({ partitionKey: "Binary", rowKey: "Binary Base64", hello: { value: "SGVsbG8h", type: "Binary" } }); // Note that "48656c6c6f21" is "Hello!" encoded in hexadecimal const result1 = await client.listEntities({ disableTypeConversion: true, queryOptions: { filter: "hello eq binary'48656c6c6f21'" } }).byPage().next(); // Note that "SGVsbG8h" is "Hello!" encoded in Base64 const result2 = await client.listEntities({ disableTypeConversion: true, queryOptions: { filter: "hello eq binary'SGVsbG8h'" } }).byPage().next();
- Observe the console output.
Here, result1
contains the entity inserted into the table in the previous line. But attempting to get result2
causes an error to be thrown.
Expected behavior
I would expect the encoding for binary values when disableTypeConversion
is true
to be consistent with the encoding accepted by the service in query strings.
I realize that this may be the format that the platform returns. There's not a lot of documentation about working with binary values. This may be something to bring up with the platform team.