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

SAP IQ translator wrong pushdown of query with multiple JOINs

XMLWordPrintable

      For a query:

      SELECT BQT1.SmallA.IntKey AS SmallA_IntKey, BQT2.MediumB.IntKey AS MediumB_IntKey, BQT2.LargeB.IntKey AS LargeB_IntKey
      FROM
          (
              BQT1.SmallA LEFT OUTER JOIN BQT2.MediumB
                   ON BQT1.SmallA.IntKey = BQT2.MediumB.IntKey
          )
          RIGHT OUTER JOIN BQT2.LargeB
               ON BQT2.MediumB.IntKey = BQT2.LargeB.IntKey
      WHERE BQT2.LargeB.IntKey < 1500
      

      The following source command is pushed to SAP IQ:

      SELECT g_1."intkey" AS c_0, g_2."intkey" AS c_1, g_0."intkey" AS c_2
      FROM
          "bqt-server"."dvqe"."LargeB" AS g_0 
          LEFT OUTER JOIN
          "bqt-server"."dvqe"."SmallA" AS g_1
          INNER JOIN "bqt-server"."dvqe"."MediumB" AS g_2
          ON g_1."intkey" = g_2."intkey"
          ON g_2."intkey" = g_0."intkey"
      AND g_2."intkey" < 1500
      WHERE g_0."intkey" < 1500
      

      Which results in parsing error.

              rhn-engineering-shawkins Steven Hawkins
              jstastny@redhat.com Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: