3 Replies Latest reply on Oct 31, 2011 3:12 PM by rareddy

    backporting custom translators from teiid 7.5 to EDS 5.1

    fsauer65

      I have some custom translators I wrote with teiid 7.5.0.final, which were working fine in that environment.

      All they do is register a bunch of UDFs. They inherit from the regular translators for db2, oracle and teradata. I am trying to get these to work in EDS 5.1 which uses teiid 7.1.1.GA (which I can't seem to find in any maven repository by the way). The problem is that they deploy and show up in the admin console, but the UDFs don't work at all. When I invoke a query using them, it immediately errors out with an error like

       

      Error Code:ERR.015.008.0039 Message:Remote org.teiid.api.exception.query.QueryPlannerException: Error Code:ERR.015.008.0039 Message:Error Code:ERR.015.008.0039 Message:The function 'HEX(SUBSTRING(AAH.SECMAS.FILLER001, 87, 4))' is an unknown form.  Check that the function name and number of arguments is correct.

       

      what am I missing here? All the UDFs behave this way while they all worked in a teiid 7.5 environment.

       

      I did notice that - when I try to compile my translators using teiid 7.1.0.final (can't find 7.1.1.GA) - the compiler does not like the description argument of the @Translator annotation. But since the translators are also registered via xml I'm not sure whether this is the problem or not. Or are there two separate translator discovery mechanisms in play here? When I attach a debugger and set a breakpoint in the start() method of the translators I see it invoked but I never see the getSupportedFunctions() being invoked.

       

      Thanks,

       

      Frank Sauer

      DSTH Health Solutions

       

      P.S.

       

      HEX is not a custom function actually, but the included db2 translator does not register it.

      See http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000811.htm

        • 1. Re: backporting custom translators from teiid 7.5 to EDS 5.1
          rareddy

          Frank,

          I am trying to get these to work in EDS 5.1 which uses teiid 7.1.1.GA (which I can't seem to find in any maven repository by the way).

          7.1.1 is not a community release, or release at all, it just branch, thus you do not find any maven artifacts. Also, I believe we started pushing the maven artifacts after or at 7.2

           

           

          what am I missing here? All the UDFs behave this way while they all worked in a teiid 7.5 environment.

          7.5 does add more seamless functionality for the pushdown functions. Especially the "getPushdownFunctions" call in the ExecutionFactory class.

           

           

          I did notice that - when I try to compile my translators using teiid 7.1.0.final (can't find 7.1.1.GA) - the compiler does not like the description argument of the @Translator annotation. But since the translators are also registered via xml I'm not sure whether this is the problem or not. Or are there two separate translator discovery mechanisms in play here? When I attach a debugger and set a breakpoint in the start() method of the translators I see it invoked but I never see the getSupportedFunctions() being invoked.

          The "description" attribute to @Translator was added in the 7.1.1 branch and we pulled forward that change may be in 7.2. So, I suggest you use the 7.1.1 jar from your EDS installation. Yes, there is XML based deployment too, but it is undocumented, may be removed in the future. The @Translator is still required. getSupportedFunctions gets invoked when the engine enquires about the translators capabilities, that could be very first time you issue the query.

           

          what I would suggest is take the 7.1.1 copy of the DB2 translator, and extend it for your use. EDS 5.2 (coming soon) defines a new way to define the source pushdown functions in source model, such that extending the translator for that purpose in not necessary.

           

          You can open enhancement JIRA for Teiid, so that we will add to the future releases of this translators.

           

          Thanks

           

          Ramesh..

          • 2. Re: backporting custom translators from teiid 7.5 to EDS 5.1
            fsauer65

            I tried what you suggested and got my code to compile with only jars from EDS 5.1 (the 7.1.1.GA branch) but I still see the exact same behavior. start() gets called, getSupportedFunctions is never invoked not even when I run a query invoking a custom function, I still consistently get this error:

             

            Message:Remote org.teiid.api.exception.query.QueryResolverException: Error Code:ERR.015.008.0039 Message:The function 'curdate_()' is an unknown form.  Check that the function name and number of arguments is correct.

             

            What else do I need to do to make this work?

            • 3. Re: backporting custom translators from teiid 7.5 to EDS 5.1
              rareddy

              Frank,

               

              Let me re-phrase what I said before, it will ask for capabilities first time it needs to consult them, like the example you are using when using a function, check for join support etc. Check SouceCapabilities.java class for all the capabilities.

               

              I believe you may be running into the same issue as this thread

               

              http://community.jboss.org/thread/173399?tstart=0

               

              where the function is being used on a projected column (select func(foo) ..), as this may not work with the version you are working with due to feature limitations. If this not case, can you provide the query plan to further diagnose it.

               

              Ramesh..