Open supernoodles opened 7 years ago
No response in 10 days from anyone... :-(
Now raising as a support request from within Azure Portal.
We apologies for the late response :-( But thank you for raising this. The engineering team is investigating.
Consider the following USQL (reflecting the issue we've observed in our production development):
The aggregator in this case is the the sample custom aggregator from the USQL reference doc (our production code is different, but the problem is demonstrable with the sample UDAGG code):
When executed, either within an ADLA instance in Azure or using the USQL local run environment within Visual Studio 2017, the result is:
The built-in USQL SUM aggregator has returned NULL rather than the expected output of 3 for the row with Name A. Removing the call to the user-defined aggregator returns a rowset with the expected SUM aggregation value of 3:
This is clearly inconsistent behaviour for the SUM aggregate which shouldn't care if a UDAGG is included in the processing of the same group. Interestingly, if the @result query is modified to:
Then the output is:
In this case the introduction of the AVG aggregator both produces the expected average as well as coaxing the SUM aggregator into also producing the correct answer! At present we've implemented two workarounds:
Obviously neither work around is ideal as we may care that the result of a SUM aggregate is actually NULL if there were no non-NULL values to sum in the group.