Skip to content

Fix flaky TPC-H Q15 floating-point assertion#5629

Merged
ahkcs merged 1 commit into
opensearch-project:mainfrom
ahkcs:fix/5620-tpch-q15-flaky
Jul 15, 2026
Merged

Fix flaky TPC-H Q15 floating-point assertion#5629
ahkcs merged 1 commit into
opensearch-project:mainfrom
ahkcs:fix/5620-tpch-q15-flaky

Conversation

@ahkcs

@ahkcs ahkcs commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Description

Updates the TPC-H Q15 integration test to use the existing ULP-aware MatcherUtils.closeTo(...) matcher for total_revenue.

The distributed sum() returned 797313.3838000001 in the failing release test instead of the exactly asserted 797313.3838. These values differ by one ULP, but rows(...) requires exact numeric equality. closeTo(...) tolerates platform-dependent floating-point rounding while continuing to compare the supplier ID and string fields exactly.

Related Issues

Resolves #5620

Testing

  • ./gradlew :integ-test:spotlessJavaCheck :integ-test:compileTestJava --no-daemon
  • ./gradlew :integ-test:integTest --tests "org.opensearch.sql.calcite.tpch.CalcitePPLTpchIT.testQ15" --no-daemon

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Apply closeTo only to floating-point value

The closeTo method is being used with mixed types (integers, strings, and a double),
which may not be the intended usage. Consider using closeTo only for the
floating-point value total_revenue while keeping exact matches for other fields.
This would provide more precise validation for non-numeric fields.

integ-test/src/test/java/org/opensearch/sql/calcite/tpch/CalcitePPLTpchIT.java [317]

-closeTo(10, "Supplier#000000010", "Saygah3gYWMp72i PY", "34-852-489-8585", 797313.3838)
+rows(10, "Supplier#000000010", "Saygah3gYWMp72i PY", "34-852-489-8585", closeTo(797313.3838, 0.01))
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that closeTo is being applied to all parameters including non-numeric fields, when it should only be used for the floating-point total_revenue value. This is a significant correctness issue that could lead to improper test validation.

Medium

@ahkcs ahkcs added infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. maintenance Improves code quality, but not the product and removed infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. labels Jul 15, 2026
@ahkcs ahkcs merged commit ee52914 into opensearch-project:main Jul 15, 2026
47 of 49 checks passed
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.

[AUTOCUT] Integration Test Failed for sql-3.8.0

2 participants