1 Reply Latest reply on Apr 13, 2015 9:48 AM by Steven Hawkins

    Pushdown the whole query

    Michał Warecki Novice

      Hi guys,

       

      I have a question regarding pushing down query to source system the whole query without any exceptions. For last few days I was adding a lot of functions, enabling a lot of supports* flags etc. but still there are cases where I've got exceptions what starting to frustrate me. For example this simple query:

       

      SELECT

         tstudent(count(somecolumn) - 1)

      FROM sometable

      GROUP BY somecolumn;

       

      I've defined tstudent as a pushdown function and when I execute tstudent(count(somecolumn)) it works but in case above there is exception:

      org.teiid.api.exception.query.QueryPlannerException: TEIID30258 Expression(s) tstudent((anon_grp0.agg0 - 1)) cannot be pushed to source.

       

      I've debug that and see that all of the scalar functions like -/*+ are not in capabilities functions list. There are only functions that I've added explicitly. Later, I've added -/*+ to addPushDownFunction but it requires prefix to be specified what is not what I want. How can I support such functions?

      The best will to be support everything and just push down the whole query.

       

      Best,

      Michal

        • 1. Re: Pushdown the whole query
          Steven Hawkins Master

          > I've debug that and see that all of the scalar functions like -/*+ are not in capabilities functions list. There are only functions that I've added explicitly. Later, I've added -/*+ to addPushDownFunction but it requires prefix to be specified what is not what I want. How can I support such functions?

           

          Any function that matches a teiid system function is declared in the getSupportedFunctions list.  There you just declare support by name as it's expected that you'll support all forms of the analogous system function - with the exceptions that specific conversions and formatting can have their pushdown tuned.