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

filter clause with where <literal>=<literal> or <identifier>=<identifier> fail or are slow #10383

Closed
jadami10 opened this issue Mar 6, 2023 · 1 comment · Fixed by #10444
Closed
Labels

Comments

@jadami10
Copy link
Contributor

jadami10 commented Mar 6, 2023

Queries with filter where 1=1 will fail. Several of the optimizers hit a null pointer exception. I tried tracking these down, but kept hitting ever more complex null pointer issues.

Queries with filter where "colA" = "colA" work correctly, but for expensive queries, these end up taking almost twice as long.

While this is quite a weird edge case, we see it where users are passing a string query between functions. They start the query with where A=A so they can keep appending filters after that without need to know if there was already a filter.

@Jackie-Jiang
Copy link
Contributor

The reason why where colA = colA is slow is because it will be converted to where colA - colA = 0, which involves transform.
One solution is to remove the equality predicate when the LHS and RHS are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants