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

[Backport 2.x] Rework on OpenSearchDataType: parse, store and use mapping information #1455

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport d44cd39 from #1314

…ion (#1314)

* Rework on `OpenSearchDataType`: parse, store and use mapping information (#180)

Rework on `OpenSearchDataType`:
* Add data types for those classes are not defined in `ExprCoreType`.
* Address Bit-Quill#180 (comment)
* Remove `TextKeywordValue`.
* Add changes according to the PR review. Bit-Quill#180
* Update `IndexMapping::parseMapping` function.
* Add `OpenSearchDataType::resolve` function.
* Add new constructor for `OpenSearchTextType`.
* Make `fields` and `properties` in `OpenSearchDataType` readonly. Update tests and mapping parser.
* Move `getFields` from `OpenSearchDataType` to `OpenSearchTextType`. Update tests.
* Rewrite `traverseAndFlatten` according to Bit-Quill#180 (comment)
* Minor comment fix.
* A fix to avoid breaking changes.
* `typeName` and `legacyTypeName` to return different type names.
* Change `typeof` function and corresponding tests.
* Move `convertTextToKeyword` from `ScriptUtils` to `OpenSearchTextType`. Update tests.
* Update UT for `typeof` function.
* Make all instances of `OpenSearchDataType` and of derived types singletones as much as possible.
* Make string representations of all `ExprType`s uppercase.
* Remove functions from `IndexMapping` used in tests only.

Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
(cherry picked from commit d44cd39)
@opensearch-trigger-bot opensearch-trigger-bot bot requested a review from a team as a code owner March 21, 2023 02:21
@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2023

Codecov Report

Merging #1455 (37e432c) into 2.x (305ba24) will increase coverage by 0.01%.
The diff coverage is 100.00%.

📣 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              @@
##                2.x    #1455      +/-   ##
============================================
+ Coverage     98.44%   98.46%   +0.01%     
- Complexity     3804     3844      +40     
============================================
  Files           343      345       +2     
  Lines          9446     9550     +104     
  Branches        601      613      +12     
============================================
+ Hits           9299     9403     +104     
  Misses          142      142              
  Partials          5        5              
Flag Coverage Δ
sql-engine 98.46% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...arch/storage/script/filter/lucene/LuceneQuery.java 100.00% <ø> (ø)
...g/opensearch/sql/data/model/AbstractExprValue.java 100.00% <100.00%> (ø)
...ava/org/opensearch/sql/data/type/ExprCoreType.java 100.00% <100.00%> (ø)
...nsearch/sql/expression/system/SystemFunctions.java 100.00% <100.00%> (ø)
...sql/opensearch/data/type/OpenSearchBinaryType.java 100.00% <100.00%> (ø)
...h/sql/opensearch/data/type/OpenSearchDataType.java 100.00% <100.00%> (ø)
...l/opensearch/data/type/OpenSearchGeoPointType.java 100.00% <100.00%> (ø)
...rch/sql/opensearch/data/type/OpenSearchIpType.java 100.00% <100.00%> (ø)
...h/sql/opensearch/data/type/OpenSearchTextType.java 100.00% <100.00%> (ø)
...ensearch/data/value/OpenSearchExprBinaryValue.java 100.00% <100.00%> (ø)
... and 14 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 Mar 21, 2023
@Yury-Fridlyand Yury-Fridlyand merged commit 5cfa702 into 2.x Mar 21, 2023
@github-actions github-actions bot deleted the backport/backport-1314-to-2.x branch March 21, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Improves code quality, but not the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants