fix(workflow-operator, v1.2): qualify the AsterixDB FROM clause; add AsterixDBSourceOpExec unit tests - #7006
Open
Yicong-Huang wants to merge 1 commit into
Conversation
…xDBSourceOpExec unit tests (#6878) ### What changes were proposed in this PR? **Source fix.** `AsterixDBSourceOpExec.addBaseSelect` built its query with ```scala s"... FROM $desc.database.$desc.table WHERE 1 = 1 " ``` In Scala that interpolates the `desc` **object** and then appends the literal text `.database` / `.table`, so the generated FROM clause was malformed and the operator's main query could never run. Line 288 of the same file already does it correctly (`desc.database + "." + desc.table`), confirming the intent. Fixed to `${desc.database}.${desc.table}`. The bug surfaced while writing tests for this file, which had **0% coverage**. A reviewer rightly pointed out the first draft pinned the buggy string; the spec now asserts the corrected clause instead. **Tests.** Adds `AsterixDBSourceOpExecSpec` (47 tests) covering the SQL++ string-building surface (no JDBC in this class): - `addFilterConditions` and each branch it dispatches to — `addKeywordSearch` (ftcontains; `IllegalArgumentException` on a non-STRING column), `addRegexSearch`, `addGeoSearch` (create_rectangle for 2 corners, create_polygon beyond that, OR-joined spatial_intersect, `NumberFormatException` on a malformed point), `addGeneralFilterCondition`; - the skip paths for every toggle-off / missing-input case, and the composed keyword→regex→geo→general ordering; - schema derivation from the AsterixDB datatype, and the base-select/limit/offset fragments. **Test-infra fix.** `AsterixDBConnUtilSpec` now removes only its own keys from the JVM-wide `AsterixDBConnUtil.asterixDBVersionMapping` singleton instead of calling `clear()`: sbt runs suites in parallel within one JVM, so a blanket clear could evict the new suite's cached entry mid-run. Both suites also now call `super.beforeAll`/`beforeEach` and wrap `afterAll` teardown in try/finally. ### Any related issues, documentation, discussions? Closes #6875. ### How was this PR tested? `sbt -java-home <jbr-17> "WorkflowOperator/testOnly *AsterixDB*"` -> 84 succeeded, 0 failed (across `AsterixDBSourceOpExecSpec`, `AsterixDBConnUtilSpec`, `AsterixDBSourceOpDescSpec`). `Test/scalafmtCheck`, `scalafmtCheck`, `Test/scalafix --check` and `scalafix --check` all clean. ### Was this PR authored or co-authored using generative AI tooling? (backported from commit 52584a8) Generated-by: Claude Code (Opus 4.8 [1M context])
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/v1.2 #7006 +/- ##
==================================================
- Coverage 53.95% 52.37% -1.58%
- Complexity 1441 2487 +1046
==================================================
Files 809 1077 +268
Lines 34144 42267 +8123
Branches 3448 4548 +1100
==================================================
+ Hits 18421 22136 +3715
- Misses 14815 18820 +4005
- Partials 908 1311 +403
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Backport of #6878 to
release/v1.2, cherry-picked from 52584a8.Source fix only. The test changes from #6878 were omitted: the touched test spec(s) do not exist on
release/v1.2(or depend on main-only test infrastructure), so backporting them cleanly is not possible. Only the source fix is carried over, per maintainer guidance.Any related issues, documentation, discussions?
Backport of #6878. Originally linked #6875.
How was this PR tested?
Release-branch CI runs on this PR. The source change cherry-picked cleanly; test changes were intentionally dropped (see above).
Was this PR authored or co-authored using generative AI tooling?
Yes — backport prepared with Claude Code (mechanical cherry-pick + conflict resolution; the change itself is #6878 by its original author).
🤖 Generated with Claude Code