Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azurite is more lenient than TableStorage when parsing a query #2512

Open
JimWolff opened this issue Dec 3, 2024 · 1 comment
Open

Azurite is more lenient than TableStorage when parsing a query #2512

JimWolff opened this issue Dec 3, 2024 · 1 comment
Assignees
Labels
alignment Alignment between Azurite with Azure Storage production table-query

Comments

@JimWolff
Copy link

JimWolff commented Dec 3, 2024

Recently had an error in a non-dev environment because of the differences in how Azurite and actual table storage interprets a query.

I accidentally wrote Or instead of or in my query and azurite was fine with that, things worked, but when it was run on table storage it gave me a syntax error because the or has to be lowercase.

Azurite is probably more lenient because of some of the toLowerCase code found in QueryParser.ts

  private visitOr(): IQueryNode {
    const left = this.visitAnd();

    if (this.tokens.next(t => t.kind === "logic-operator" && t.value?.toLowerCase() === "or")) {
      const right = this.visitOr();

      return new OrNode(left, right);
    } else {
      return left;
    }
  }

Not sure where in the priority the consistency beween azurite and tablestorage in production are, since they are inherently very different technologies.
Just wanted to let you know, if it was helpful, since it had me wondering for quite a while.

@EmmaZhu
Copy link
Member

EmmaZhu commented Dec 4, 2024

Hi @JimWolff ,

Thanks for reporting this to us.

Seems you already find the root cause. Azurite welcome contribution. If you'd like to help, you can raise a PR to fix it. It'd be even greater if you can help to take a look at other operator key words like: "AND", "NOT" and comparison operators like: "EQ", "LE", etc.

I can also take care of this later, only it may not be in our priority for now.

Thanks
Emma

@blueww blueww added alignment Alignment between Azurite with Azure Storage production table-query labels Dec 4, 2024
@blueww blueww self-assigned this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alignment Alignment between Azurite with Azure Storage production table-query
Projects
None yet
Development

No branches or pull requests

3 participants