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

Enable sql function ifnull, nullif and isnull #962

Merged
merged 13 commits into from Jan 14, 2021

Conversation

harold-wang
Copy link
Contributor

@harold-wang harold-wang commented Jan 6, 2021

Issue #950 , if available:

Description of changes:
Add flow control functions ifNull, nullIf and isNull (#950)

  • Init
  • UT
  • IT

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 Jan 6, 2021

Codecov Report

Merging #962 (e2f159b) into develop (d419e8e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             develop     #962    +/-   ##
===========================================
  Coverage      99.87%   99.87%            
- Complexity      2347     2396    +49     
===========================================
  Files            232      234     +2     
  Lines           5395     5500   +105     
  Branches         350      357     +7     
===========================================
+ Hits            5388     5493   +105     
  Misses             5        5            
  Partials           2        2            
Impacted Files Coverage Δ Complexity Δ
...opendistroforelasticsearch/sql/expression/DSL.java 100.00% <100.00%> (ø) 132.00 <3.00> (+3.00)
...h/sql/expression/function/BuiltinFunctionName.java 100.00% <100.00%> (ø) 3.00 <0.00> (ø)
...ion/operator/predicate/UnaryPredicateOperator.java 100.00% <100.00%> (ø) 23.00 <10.00> (+10.00)
...elasticsearch/sql/analysis/ExpressionAnalyzer.java 100.00% <0.00%> (ø) 33.00% <0.00%> (+2.00%)
...ticsearch/sql/ppl/parser/AstExpressionBuilder.java 100.00% <0.00%> (ø) 28.00% <0.00%> (+2.00%)
...ticsearch/sql/sql/parser/AstExpressionBuilder.java 100.00% <0.00%> (ø) 51.00% <0.00%> (+3.00%)
...ticsearch/sql/planner/physical/WindowOperator.java 100.00% <0.00%> (ø) 11.00% <0.00%> (+1.00%)
...csearch/sql/analysis/SelectExpressionAnalyzer.java 100.00% <0.00%> (ø) 9.00% <0.00%> (ø%)
...csearch/sql/analysis/WindowExpressionAnalyzer.java 100.00% <0.00%> (ø) 13.00% <0.00%> (+1.00%)
...csearch/sql/expression/aggregation/Aggregator.java 100.00% <0.00%> (ø) 9.00% <0.00%> (+6.00%)
... and 16 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 d419e8e...e2f159b. Read the comment docs.

@chloe-zh
Copy link
Member

chloe-zh commented Jan 7, 2021

Could you also update the user manual and add corresponding doctest cases here: https://github.com/opendistro-for-elasticsearch/sql/blob/develop/docs/user/dql/functions.rst#conditional-functions

@harold-wang harold-wang changed the title * Enable sql function ifnull and nullif * Enable sql function ifnull, nullif and isnull Jan 7, 2021
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.

legacy/src/main/antlr/OpenDistroSqlLexer.g4 Outdated Show resolved Hide resolved
@dai-chen
Copy link
Member

dai-chen commented Jan 7, 2021

Btw, I missed IF function, could you add it too? You can do it same here or a separate PR. Thanks!

An issue related: #861

@dai-chen dai-chen added enhancement New feature or request SQL labels Jan 7, 2021
@penghuo
Copy link
Contributor

penghuo commented Jan 8, 2021

  • Please add the documentation accordingly
  • Remove the leading "*" in the PR title

@harold-wang harold-wang changed the title * Enable sql function ifnull, nullif and isnull Enable sql function ifnull, nullif and isnull Jan 8, 2021
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.

Just several minor comments. Thanks for your changes!

@harold-wang harold-wang merged commit 067c7ee into opendistro-for-elasticsearch:develop Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants