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

SQL: Wrong folding of = expression and AND #35859

Open
matriv opened this issue Nov 23, 2018 · 4 comments
Open

SQL: Wrong folding of = expression and AND #35859

matriv opened this issue Nov 23, 2018 · 4 comments
Assignees
Labels
:Analytics/SQL SQL querying >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@matriv
Copy link
Contributor

matriv commented Nov 23, 2018

SELECT languages = 10 AND languages = 11 FROM test_emp where emp_no IN(10018, 10019, 10020, 10021);

returns:

     false     
---------------
false          

as the AND expression is wrongly folded to false (can also be null) and on top it becomes a LocalRelation.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@matriv
Copy link
Contributor Author

matriv commented Mar 30, 2020

@elastic/es-ql

@rjernst rjernst added the Team:QL (Deprecated) Meta label for query languages team label May 4, 2020
fixmebot bot referenced this issue in VectorXz/elasticsearch Apr 22, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch May 28, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch Aug 4, 2021
@wchaparro wchaparro removed the Team:QL (Deprecated) Meta label for query languages team label Jan 17, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 17, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@bpintea
Copy link
Contributor

bpintea commented Apr 22, 2024

FWIW, this improved partially (null still not being covered), the query SELECT emp_no, languages, languages = 10 AND languages = 11 FROM employees where emp_no IN(10018, 10019, 10020, 10021) returns as of 8.14:

    emp_no     |   languages   |languages = 10 AND languages = 11
---------------+---------------+---------------------------------
10018          |2              |false                            
10019          |1              |false                            
10020          |null           |false                            
10021          |null           |false                            

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests