1 Reply Latest reply on Mar 27, 2018 2:50 PM by Steven Hawkins

    Teiid doesn't recognize custom function in MySQL

    Ivan Chan Apprentice

      It seems like Teiid cannot recognize custom function in MYSQL

       

      1. define any custom function in MySQL

      2. create a VDB

      3. try using custom function in SQL, e.g.:
      SELECT
      device_type_tb(device_id) AS type,
      metric_value
      FROM
      metrics_tb

       

      Expected result:
      function works just like with domain based on MySQL JDBC data source

       

      Actual result:
      TEIID doesn't recognize this custom function:
      TEIID30068 The function 'device_type_tb(mysql_device_type_tb.metrics_tb.device_id)' is an unknown form. Check that the function name and number of arguments is correct.

       

      Do you guys have any idea?

       

      Thanks,

       

      Ivan

        • 1. Re: Teiid doesn't recognize custom function in MySQL
          Steven Hawkins Master

          > Do you guys have any idea?

           

          The JDBC import process currently doesn't import information on functions - driver support with DatabaseMetaData.getFunctions started with Java 6 / JDBC 4 and it's still not broadly supported. 

           

          You'll have to make Teiid aware of the source function by adding it to the metadata.  Using ddl it would be a create statement associated with the schema/model "create foreign function device_type_tb ..."

           

          You can also propose an enhancement based upon DatabaseMetaData or whatever metadata facility mysql supports for defining functions.