-
Notifications
You must be signed in to change notification settings - Fork 72
Expose op:sample-by function in Java Client API #1315
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
Comments
Besides writing a unit test using PlanBuilder.sampleByOptions(), please consider whether it makes sense to add
|
Thanks, Erik. Will do. |
The unit test throws an error, "Server Message: OPTIC-INVALARGS: fn.error(null, 'OPTIC-INVALARGS', 'limit must be a positive number: '+length); -- Invalid arguments: limit must be a positive number: 4" I found that it errors out at line 2731 of optic-impl.sjs. The number we passed in is treated as a string, not a number. Investigating. |
The limit in PlanSampleByOptions is indeed a xs:int, but later changed to String in ExportablePlan. |
Proposed changes:
|
…so modify makeMap to work with XsIntVal for fromSparql options.
…ith XsIntVal for fromSparql options.
As task in bugtrack, https://bugtrack.marklogic.com/55089
A sample query as below
xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
at "/MarkLogic/optic.xqy";
op:from-view("opticUnitTest", "musician")
=> op:sample-by(map:map()=>map:with("limit", 2))
=> op:result()
So we can address your issue, please include the following:
Version of MarkLogic Java Client API
See Readme.txt
Version of MarkLogic Server
See admin gui on port 8001 or run xdmp:version() in Query Console - port 8000)
Java version
Run
java -version
OS and version
For MAC, run
sw_vers
.For Windows, run
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
For Linux, run
cat /etc/os-release
anduname -r
Input: Some code to illustrate the problem, preferably in a state that can be independently reproduced on our end
Actual output: What did you observe? What errors did you see? Can you attach the logs? (Java logs, MarkLogic logs)
Expected output: What specifically did you expect to happen?
Alternatives: What else have you tried, actual/expected?
The text was updated successfully, but these errors were encountered: