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

Fix ASCII function and groom UT for text functions. (#301) #1895

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Jul 21, 2023

Description

Update ASCII function (to return 0 for empty string, see doc)

BEFORE

opensearchsql> select ascii('');
TransportError(503, 'StringIndexOutOfBoundsException', {'error': {'reason': 'There was internal problem at backend', 'details': 'Index 0 out of bounds for length 0', 'type': 'StringIndexOutOfBoundsException'}, 'status': 503})

AFTER

opensearchsql> select ascii('');
fetched rows / total rows = 1/1
+-------------+
| ascii('')   |
|-------------|
| 0           |
+-------------+

Update UT for all text functions (similar to #1310):

  • remove null/missing tests
  • make tests parametrized

Issues Resolved

N/A

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

* Fix `ASCII` function and groom UT for text functions.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Code cleanup.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #1895 (82a333f) into main (bb3c340) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               main    #1895   +/-   ##
=========================================
  Coverage     97.52%   97.52%           
- Complexity     4655     4656    +1     
=========================================
  Files           408      408           
  Lines         11952    11953    +1     
  Branches        829      830    +1     
=========================================
+ Hits          11656    11657    +1     
  Misses          289      289           
  Partials          7        7           
Flag Coverage Δ
sql-engine 97.52% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...g/opensearch/sql/expression/text/TextFunction.java 100.00% <100.00%> (ø)

GumpacG
GumpacG previously approved these changes Jul 25, 2023
acarbonetto
acarbonetto previously approved these changes Aug 17, 2023
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand Yury-Fridlyand dismissed stale reviews from acarbonetto and GumpacG via 82a333f August 17, 2023 23:24
@Yury-Fridlyand Yury-Fridlyand merged commit 6055c7e into opensearch-project:main Aug 21, 2023
@Yury-Fridlyand Yury-Fridlyand deleted the integ-fix-ascii branch August 21, 2023 22:28
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 23, 2023
* Fix `ASCII` function and groom UT for text functions.

* Code cleanup.

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit 6055c7e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Yury-Fridlyand pushed a commit that referenced this pull request Aug 24, 2023
…2029)

* Fix `ASCII` function and groom UT for text functions.

* Code cleanup.

---------


(cherry picked from commit 6055c7e)

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants