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

Minor clean up of datetime and other classes (#198) #1310

Merged
merged 4 commits into from
Apr 20, 2023

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Jan 30, 2023

Signed-off-by: MitchellGale-BitQuill mitchellg@bitquilltech.com
Signed-off-by: Yury-Fridlyand yury.fridlyand@improving.com
Co-authored-by: Yury-Fridlyand yury.fridlyand@improving.com

Description

Clean up lexer to make future changes easier. Make changes to documentation and code to make cleaner.

  • Groom ANTLR grammar files to make future changes easier.
  • Fix EqualsAndHashCode compilation warnings
Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.
  • Move ExprTimestampValue.ZONE constant to DateTimeUtils
  • Move ExprDatetimeValue formatter to DateTimeFormatters
  • Sort alphabetically functions in DateTimeFunction and MathematicalFunction
  • Replace FunctionDSL import by static imports to simplify code
  • Remove tests for NULL and MISSING values
  • Add validation for non-zero divider
  • Remove Environment mock from some unit tests, because it is not needed anymore
  • Groom docs to eliminate rst validator warnings
  • Add doctests for some functions
  • Make IT for now-like functions truly parametrized
  • Rename some PPL grammar entities to be consistent with SQL ones
  • Change doctest cluster type to archive which has built-in modules - this requires for some added doctests

See team review and discussion in Bit-Quill#198

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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2023

Codecov Report

Merging #1310 (3da45c7) into main (bae0f6b) will decrease coverage by 2.17%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #1310      +/-   ##
============================================
- Coverage     98.37%   96.21%   -2.17%     
+ Complexity     3686     1413    -2273     
============================================
  Files           343      152     -191     
  Lines          9070     3854    -5216     
  Branches        585      276     -309     
============================================
- Hits           8923     3708    -5215     
+ Misses          142      141       -1     
  Partials          5        5              
Flag Coverage Δ
sql-engine 96.21% <ø> (-2.17%) ⬇️

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

Impacted Files Coverage Δ
...search/executor/protector/ResourceMonitorPlan.java 100.00% <ø> (ø)
...script/filter/lucene/relevance/RelevanceQuery.java 100.00% <ø> (ø)
...a/org/opensearch/sql/data/model/ExprDateValue.java
...g/opensearch/sql/data/model/ExprDatetimeValue.java
...a/org/opensearch/sql/data/model/ExprTimeValue.java
.../opensearch/sql/data/model/ExprTimestampValue.java
...arch/sql/expression/datetime/DateTimeFunction.java
...ression/operator/arthmetic/ArithmeticFunction.java
...ssion/operator/arthmetic/MathematicalFunction.java
...on/operator/predicate/BinaryPredicateOperator.java
... and 183 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dai-chen dai-chen added the maintenance Improves code quality, but not the product label Jan 31, 2023
@Yury-Fridlyand Yury-Fridlyand marked this pull request as draft February 2, 2023 17:49
@Yury-Fridlyand Yury-Fridlyand marked this pull request as ready for review February 4, 2023 02:25
MaxKsyunz
MaxKsyunz previously approved these changes Feb 7, 2023
acarbonetto
acarbonetto previously approved these changes Feb 7, 2023
@@ -139,7 +139,7 @@ testClusters {
}))
*/
plugin ':opensearch-sql-plugin'
testDistribution = 'integ_test'
testDistribution = 'archive'
Copy link
Collaborator

Choose a reason for hiding this comment

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

need this for painless

@Yury-Fridlyand
Copy link
Collaborator Author

Rebased

@Yury-Fridlyand
Copy link
Collaborator Author

Rebased again

dai-chen
dai-chen previously approved these changes Feb 15, 2023
Copy link
Collaborator

@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 refactoring!

penghuo
penghuo previously approved these changes Feb 15, 2023
@Yury-Fridlyand Yury-Fridlyand dismissed stale reviews from penghuo and dai-chen via c4c16cd February 15, 2023 19:51
@Yury-Fridlyand
Copy link
Collaborator Author

Rebased again, please re-review

dai-chen
dai-chen previously approved these changes Feb 16, 2023
acarbonetto
acarbonetto previously approved these changes Mar 21, 2023
Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@MaxKsyunz MaxKsyunz merged commit bc29a8a into opensearch-project:main Apr 20, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1310-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 bc29a8ae86994b69bbbb44c0df1d34ca66dc5771
# Push it to GitHub
git push --set-upstream origin backport/backport-1310-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1310-to-2.x.

@Yury-Fridlyand Yury-Fridlyand deleted the integ-cleanupcode branch April 20, 2023 19:04
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 20, 2023
* Minor clean up of datetime and other classes (#198)

---------

Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit bc29a8a)
penghuo pushed a commit that referenced this pull request Apr 24, 2023
* Minor clean up of datetime and other classes (#198)

---------

Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit bc29a8a)

Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
acarbonetto pushed a commit to Bit-Quill/opensearch-project-sql that referenced this pull request Apr 28, 2023
…ct#1310)

* Minor clean up of datetime and other classes (#198)

---------

Signed-off-by: MitchellGale-BitQuill <mitchellg@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x maintenance Improves code quality, but not the product v2.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants