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

Getting invalid Query against Postgres DB

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 7.7
    • Fix Version/s: 8.10
    • Component/s: Query Engine
    • Labels:
      None

      Description

      Issuing the following query when postgres datasource is the target:

      SELECT SUM(TBALANCE) FROM TELLERS JOIN BRANCHES ON BRANCHES.BID=TELLERS.BID GROUP BY TELLERS.BID ORDER BY TELLERS.BID

      (which works when run directly against postgres)

      And getting the following exception from Teiid:

      Caused by: org.teiid.core.TeiidProcessingException: TEIID30088 Remote org.teiid.api.exception.query.QueryResolverException: TEIID30088 Unrelated order by column TELLERS.BID cannot be used in a SET query, with SELECT DISTINCT, or GROUP BY
      at org.teiid.query.resolver.util.ResolverUtil.resolveOrderBy(ResolverUtil.java:422)
      at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:94)
      at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:270)
      at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:124)
      at org.teiid.dqp.internal.process.Request.resolveCommand(Request.java:260)
      at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:370)
      at org.teiid.dqp.internal.process.Request.processRequest(Request.java:436)
      at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:600)
      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:309)
      at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
      at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:248)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:269)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:214)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shawkins Steven Hawkins
                  Reporter:
                  van.halbert Van Halbert
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: