Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

add fix to handle functions applied to literal #913

Merged

Conversation

rupal-bq
Copy link
Contributor

Issue #899

Description of changes:

  • added filter for functions with literal in select clause
  • added unit test
  • added manual IT because the comparison test didn't work for the date function.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #913 (5dace04) into develop (23a0349) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             develop     #913    +/-   ##
===========================================
  Coverage      99.85%   99.86%            
- Complexity      2149     2251   +102     
===========================================
  Files            216      229    +13     
  Lines           4851     5204   +353     
  Branches         323      342    +19     
===========================================
+ Hits            4844     5197   +353     
  Misses             5        5            
  Partials           2        2            
Impacted Files Coverage Δ Complexity Δ
...icsearch/sql/sql/parser/AstAggregationBuilder.java 100.00% <100.00%> (ø) 17.00 <4.00> (+2.00)
...endistroforelasticsearch/sql/executor/Explain.java 100.00% <0.00%> (ø) 28.00% <0.00%> (+1.00%)
...ndistroforelasticsearch/sql/analysis/Analyzer.java 100.00% <0.00%> (ø) 44.00% <0.00%> (+1.00%)
...distroforelasticsearch/sql/data/type/ExprType.java 100.00% <0.00%> (ø) 7.00% <0.00%> (+1.00%)
...troforelasticsearch/sql/sql/parser/AstBuilder.java 100.00% <0.00%> (ø) 28.00% <0.00%> (+6.00%)
...roforelasticsearch/sql/data/type/ExprCoreType.java 100.00% <0.00%> (ø) 10.00% <0.00%> (+1.00%)
...relasticsearch/sql/ppl/domain/PPLQueryRequest.java 100.00% <0.00%> (ø) 6.00% <0.00%> (+3.00%)
...relasticsearch/sql/sql/domain/SQLQueryRequest.java 100.00% <0.00%> (ø) 21.00% <0.00%> (+8.00%)
...relasticsearch/sql/planner/DefaultImplementor.java 100.00% <0.00%> (ø) 16.00% <0.00%> (+1.00%)
...elasticsearch/sql/analysis/symbol/SymbolTable.java 100.00% <0.00%> (ø) 17.00% <0.00%> (+3.00%)
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23a0349...5dace04. Read the comment docs.

Copy link
Member

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Just a minor request, could you remove isNonLiteral()? I think the current isNonLiteralFunction() takes care of it.

@rupal-bq
Copy link
Contributor Author

Thanks for the fix! Just a minor request, could you remove isNonLiteral()? I think the current isNonLiteralFunction() takes care of it.

Sure, will remove it.

@chloe-zh chloe-zh merged commit 8a44305 into opendistro-for-elasticsearch:develop Dec 14, 2020
penghuo pushed a commit that referenced this pull request Dec 15, 2020
* add functions with literal

* address PR comments

* remove unnecessary check. anyMatch returns false for empty list.

* remove isNonLiteral()

Co-authored-by: Rupal Mahajan <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants