Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5714

Can't push cross source function

    XMLWordPrintable

Details

    • Hide

      An ugly workaround would be to use a procedure:

      begin
      create local temporary table t (c bigdecimal);
      loop on (SELECT TAB1.STRINGCOL, TAB1.DATE FROM MODEL2.TABLE1 TAB1) as x
      begin
      insert into t values (MODEL1."dbo.examplefunc"(STRINGCOL, DATE, TRUE) );
      end
      select * from t;
      end

      If there is another source table on MODEL1 another slightly less ugly workaround would be to use a subquery associated with MODEL1:

      SELECT (SELECT MODEL1."dbo.examplefunc"(TAB1.STRINGCOL, TAB1.DATE, TRUE) FROM MODEL1.TABLEX LIMIT 1) MODEL2.TABLE1 TAB1

      Show
      An ugly workaround would be to use a procedure: begin create local temporary table t (c bigdecimal); loop on (SELECT TAB1.STRINGCOL, TAB1.DATE FROM MODEL2.TABLE1 TAB1) as x begin insert into t values (MODEL1."dbo.examplefunc"(STRINGCOL, DATE, TRUE) ); end select * from t; end If there is another source table on MODEL1 another slightly less ugly workaround would be to use a subquery associated with MODEL1: SELECT (SELECT MODEL1."dbo.examplefunc"(TAB1.STRINGCOL, TAB1.DATE, TRUE) FROM MODEL1.TABLEX LIMIT 1) MODEL2.TABLE1 TAB1

    Description

      With two sources, MODEL1 and MODEL2, with a function on MODEL1:

      CREATE FOREIGN FUNCTION "dbo.examplefunc"(col1 string, col2 date, col3 boolean) returns bigdecimal;

      A query of the function against only a table on MODEL2 will fail with "cannot be pushed to source":

      SELECT MODEL1."dbo.examplefunc"(TAB1.STRINGCOL, TAB1.DATE, TRUE) FROM MODEL2.TABLE1 TAB1

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            rhn-engineering-shawkins Steven Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: