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 on bool column not working properly in SQL Lab -> Explore #10098
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
Could you add the type of database, please? |
It's presto and that particular query goes to hive |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
issue still persists on presto database. It's not possible to replicate for mysql as mysql interpret boolean as tinyint. Sqllab correctly sees the type of the column: @etr2460, @john-bodley - curious if you have similar issue @ airbnb. |
Maybe we need conditional operators based on data type. |
@junlincc @zuzana-vej I wonder if we should prioritize this, i.e., not being able to filter on a boolean column using |
* Restrict operators when column is boolean * refactor 'isOperatorRelevant' a little bit * Include 'BOOLEAN' to handle presto * Update tests * number column should show bool operators * fix test - some dbs translate true/false to 1/0 * Fix tests and add linting * When column type is boolean, show bool operators * Address PR comments - simplify conditions * Fix a linting error * Addressing PR comment - remove unused variables
* Restrict operators when column is boolean * refactor 'isOperatorRelevant' a little bit * Include 'BOOLEAN' to handle presto * Update tests * number column should show bool operators * fix test - some dbs translate true/false to 1/0 * Fix tests and add linting * When column type is boolean, show bool operators * Address PR comments - simplify conditions * Fix a linting error * Addressing PR comment - remove unused variables
* Restrict operators when column is boolean * refactor 'isOperatorRelevant' a little bit * Include 'BOOLEAN' to handle presto * Update tests * number column should show bool operators * fix test - some dbs translate true/false to 1/0 * Fix tests and add linting * When column type is boolean, show bool operators * Address PR comments - simplify conditions * Fix a linting error * Addressing PR comment - remove unused variables
* Restrict operators when column is boolean * refactor 'isOperatorRelevant' a little bit * Include 'BOOLEAN' to handle presto * Update tests * number column should show bool operators * fix test - some dbs translate true/false to 1/0 * Fix tests and add linting * When column type is boolean, show bool operators * Address PR comments - simplify conditions * Fix a linting error * Addressing PR comment - remove unused variables
When a query in SQL Lab is executed and a filter is applied to a boolean column, it errors out on datatype comparison (boolean vs string).
Note - the behavior
Expected results
The filter should work - the generated query should not enclose the field value in single quotes.
Actual results
The query generated encloses the filter value in single quotes so the where clause generated looks (some_bool_flag = 'true') and this that in turn generates type mismatch
How to reproduce the bug
Environment
(please complete the following information):
0.34.1
python --version
Python 3.6.9
node -v
v12.18.0
npm -v
6.14.4
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
I have no control over the environment :(
Additional context
When the filter is entered using the Custom SQL instead of Simple, it works fine
The text was updated successfully, but these errors were encountered: