Skip to content

Issue 19271: Fix DerivedFieldScript to support emitting Float type#19303

Merged
rishabhmaurya merged 3 commits intoopensearch-project:mainfrom
ishag4:issue-19271
Sep 17, 2025
Merged

Issue 19271: Fix DerivedFieldScript to support emitting Float type#19303
rishabhmaurya merged 3 commits intoopensearch-project:mainfrom
ishag4:issue-19271

Conversation

@ishag4
Copy link
Copy Markdown
Contributor

@ishag4 ishag4 commented Sep 15, 2025

Description

This change addresses a bug in DerivedFieldScript where emitting Float values was not supported, even though the official OpenSearch documentation lists Float as a valid type for derived field scripts.

Issue: The getObjectByteSize method in DerivedFieldScript only accounted for Double, Integer, Long, Boolean, String, and Tuple types. Emitting a Float previously caused an IllegalArgumentException.

Fix: Added support for Float in getObjectByteSize so that scripts emitting Float values are handled correctly without errors.

Tests: A new test testEmittingFloatField has been added in DerivedFieldScriptTests to verify that Float values can be emitted successfully. Existing tests for Double, GeoPoint, multiple values, and byte-size limit continue to pass.

Related Issues

Resolves #19271

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@rishabhmaurya
Copy link
Copy Markdown
Contributor

@ishag4 thank you for fixing it

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 6566be6: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 094b6ea: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 5198dd4: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.00%. Comparing base (7e0c6ea) to head (5198dd4).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19303      +/-   ##
============================================
+ Coverage     72.96%   73.00%   +0.03%     
- Complexity    69825    69829       +4     
============================================
  Files          5667     5667              
  Lines        320555   320557       +2     
  Branches      46348    46349       +1     
============================================
+ Hits         233908   234008     +100     
+ Misses        67769    67644     -125     
- Partials      18878    18905      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rishabhmaurya rishabhmaurya merged commit 6c4f3d8 into opensearch-project:main Sep 17, 2025
34 of 36 checks passed
jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
Signed-off-by: Ankit Jain <jainankitk@apache.org>
jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
Signed-off-by: Ankit Jain <jainankitk@apache.org>
asimmahmood1 pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 23, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
pranikum pushed a commit to pranikum/OpenSearch that referenced this pull request Sep 23, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
…pensearch-project#19303)

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for Bug in DerivedFieldScript should support emitting Float type object: opensearch-project#19271

Signed-off-by: ishag4 <isha26701@gmail.com>

* Fix for bug in DerivedFieldScript: support emitting Float type object opensearch-project#19271

Signed-off-by: Isha Gupta <igupta24@apple.com>

---------

Signed-off-by: ishag4 <isha26701@gmail.com>
Signed-off-by: Isha Gupta <igupta24@apple.com>
Co-authored-by: Isha Gupta <igupta24@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Search Search query, autocomplete ...etc skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DerivedFieldScript should support emitting Float type object

3 participants