The sort comparator crashes when sort key values are a mix of Integer and Double. This commonly happens with $round(), which returns Integer for whole-number results and Double for fractional ones.
Reproduction:
[{"name": "a", "value": 12}, {"name": "b", "value": 5.9}, {"name": "c", "value": 8}] ^(<value)
Result:
java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer
at java.lang.Integer.compareTo(Integer.java:77)
at com.dashjoin.jsonata.Jsonata$4.compare(Jsonata.java:1383)