Github user nickwallen commented on a diff in the pull request: https://github.com/apache/metron/pull/942#discussion_r170595688 --- Diff: metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/OrdinalFunctions.java --- @@ -37,17 +35,23 @@ * Return the maximum value of a list of input values in a Stellar list */ @Stellar(name = "MAX" - , description = "Returns the maximum value of a list of input values" - , params = {"list - List of arguments. The list may only contain objects that are mutually comparable / ordinal (implement java.lang.Comparable interface)" + + , description = "Returns the maximum value of a list of input values or from a statistics object" + , params = {"stats - The Stellar statistics object" + ,"list - List of arguments. The list may only contain objects that are mutually comparable / ordinal (implement java.lang.Comparable interface)" + " Multi type numeric comparisons are supported: MAX([10,15L,15.3]) would return 15.3, but MAX(['23',25]) will fail and return null as strings and numbers can't be compared."} - , returns = "The maximum value in the list, or null if the list is empty or the input values were not comparable.") + , returns = "The maximum value in the list or from stats, or null if the list is empty or the input values were not comparable.") public static class Max extends BaseStellarFunction { @Override public Object apply(List<Object> args) { if (args.size() < 1 || args.get(0) == null) { throw new IllegalStateException("MAX function requires at least a Stellar list of values"); --- End diff -- With your changes, this error message is now incorrect. Can you update this? This only checks the number of args, so the error message should probably just say that we expect one argument or something to that effect.
---