MLE-29888 Add cts expressions as allowable cts params#1943
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prepares the Java Client API’s Optic plan execution/binding support for MarkLogic 12.1 by allowing cts:param() placeholders to be bound to CTS query expressions (so Optic bindings can safely parameterize fromSearch(...)/CTS-driven filters).
Changes:
- Introduces
CtsParamExprand updates CTSparam(...)plumbing socts:param()placeholders can be identified and bound toCtsQueryExpr. - Implements built-plan CTS query binding by rewriting the plan AST prior to execution; explicitly rejects this for raw plans.
- Adds/updates tests covering CTS query placeholder export/binding behavior and Optic search roundtrips.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| marklogic-client-api/src/test/java/com/marklogic/client/test/rows/RowManagerTest.java | Adds Optic integration tests for binding cts:param() placeholders in fromSearch(...) plans. |
| marklogic-client-api/src/test/java/com/marklogic/client/impl/PlanRowColTypesImplTest.java | Fixes malformed imports. |
| marklogic-client-api/src/test/java/com/marklogic/client/impl/CtsParamExprTest.java | Adds tests for exporting/binding CTS param placeholders and an end-to-end Optic roundtrip. |
| marklogic-client-api/src/main/java/com/marklogic/client/type/CtsParamExpr.java | Adds generated marker interface for cts:param() placeholders. |
| marklogic-client-api/src/main/java/com/marklogic/client/impl/RowManagerImpl.java | Rejects CTS query placeholder binding for raw plans via explicit UnsupportedOperationException. |
| marklogic-client-api/src/main/java/com/marklogic/client/impl/PlanBuilderSubImpl.java | Stores CTS query bindings on built plans and rewrites AST in getHandle() when bindings exist. |
| marklogic-client-api/src/main/java/com/marklogic/client/impl/CtsExprImpl.java | Makes cts:param() return a CtsParamExpr implementation. |
| marklogic-client-api/src/main/java/com/marklogic/client/impl/BaseTypeImpl.java | Adds utilities to extract cts:param() names and replace param nodes with bound CTS query AST nodes. |
| marklogic-client-api/src/main/java/com/marklogic/client/expression/PlanBuilderBase.java | Adds new bindParam overloads for CTS query bindings. |
| marklogic-client-api/src/main/java/com/marklogic/client/expression/CtsExpr.java | Changes param(...) return types to CtsParamExpr. |
| .gitignore | Ignores .codesight. |
451e1c4 to
b2ee274
Compare
jonmille
previously approved these changes
Jun 18, 2026
rjrudin
reviewed
Jun 18, 2026
5a93efe to
08e9e3a
Compare
08e9e3a to
0398013
Compare
RitaChen609
reviewed
Jun 23, 2026
0398013 to
02749a8
Compare
RitaChen609
approved these changes
Jun 24, 2026
jonmille
approved these changes
Jun 24, 2026
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.
In preparation for MarkLogic 12.1, allow for the use of cts queries in Optic bindings.