5 Replies Latest reply on Sep 26, 2013 1:01 PM by Steven Hawkins

    User Defined Aggregate Function

    gadeyne.bram Master

      Hi,

       

      I'm using Teiid 8.3 and I'm trying to add the UDAF as described in this post: http://teiid.blogspot.be/2012_04_01_archive.html

       

      I noticed that the teiid designer issued a warning that normal user defined function model als depricated. So I added a new function in a relational model using new -> child -> procedure -> UDF.

       

      Then I entered the necessary fields and selected Aggregate, returns non on null and allows order by and added a new jar counting the necessary code implementing UserDefinedAggregate<String>.

       

      I then synchronized my VDB and deployed it to the teiid server.

       

      All seems fine except when I execute a funtion like

       

      select a, GROUP_CONCAT(b, ',')

      from table

      group by a

       

      i get an error: org.teiid.api.exception.query.QueryValidatorException: TEIID30492 [b] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.

       

      However I'm sure I've indicated that GROUP_CONCAT should be a aggregate function.

       

      How can I resolve this?

       

      With kind regards

      Bram