Skip to content

Inconsistent representation of binary values in listEntity results and query strings #20514

Closed as not planned

Description

  • 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

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

  1. 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();
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Tablescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions