Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/16404
  
    DB2 has such a limit. See the error message `SQL -583`: 
http://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00583n.html
    
    > The routine (function or method) or expression is defined as 
non-deterministic or as having external action. This is not supported in the 
context in which it is used. The contexts in which these are not valid are:
    
    > in an expression of a GROUP BY clause
    
    It documents the same workaround: 
    > Remove the non-deterministic or external action routine or expression 
from the GROUP BY clause. If grouping is desired on a column of the result that 
is based on a non-deterministic or external action routine or expression use a 
nested table expression or a common table expression to first provide a result 
table with the expression as a column of the result.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to