[COMPASS-4475] Aggregation tool generating Java code that causes runtime errors Created: 27/Oct/20 Updated: 29/Oct/23 Resolved: 03/Feb/21 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Aggregation pipeline |
| Affects Version/s: | 1.22.1 |
| Fix Version/s: | 1.26.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Michael Pratt | Assignee: | Michael Rose (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
node.js / npm versions: v12.12.0 / 6.13.4 |
||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||||||||||||||||||||||
| Sprint: | Iteration Uglifruit | ||||||||||||||||||||||||||||||||||||
| Description |
|
I've built a pipeline in Compass that uses a project phase with $reduce: I have a project phase that also uses $reduce:
The pipeline executes fine in Compass and gives me back to documents I expect. However, when I export to Java driver code, the code that is generated results in a runtime error in my application. Here is the Java code that is generated is:
And the error that is returned:
As some background, this was a pipeline I generated over a year ago (not sure the precise Compass version) and it worked fine with Java driver 3.x and Server 3.x. A few months ago the server was upgraded to 4.x, and the pipeline continued to run fine using Java driver 3.x. It wasn't until I upgraded the Java driver to 4.x that this issue came up. I have rebuilt the pipeline in the latest Compass version, and confirmed it still generates the same snippet of Java code that results in the error. |
| Comments |
| Comment by Githook User [ 03/Feb/21 ] | |||||||
|
Author: {'name': 'Michael Rose', 'email': 'michael_rose@gmx.de', 'username': 'rose-m'}Message: fix(export-to-language): Disable builders for Java pipeline export | |||||||
| Comment by Michael Pratt [ 27/Oct/20 ] | |||||||
|
For reference, here's some pure BSON that works in place of the generated reduce code:
|