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

Improve error message when using LATERAL reference in RIGHT or FULL joins

XMLWordPrintable

    • Icon: Quality Risk Quality Risk
    • Resolution: Done
    • Icon: Major Major
    • 10.2
    • 10.1
    • Query Engine
    • None

      All table functions cause errors in queries containing RIGHT or FULL JOINs. For example, such query:

      select * from views.v x1 right join table(select x1.b a) x2 on x1.a=x2.a ;;
      

      causes such error:

      Unable to find source-code formatter for language: noformat. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      2018-03-05 10:25:02,356 WARN  [org.teiid.PROCESSOR] (Worker3_QueryProcessorQueue31) /oCxMs2/Zs22 TEIID30020 Processing exception for request /oCxMs2/Zs22.26 'TEIID31119 Symbol x1.b i
      s specified with an unknown group context'. Originally QueryResolverException ResolverVisitor.java:102.: org.teiid.api.exception.query.QueryResolverException: TEIID31119 Symbol x1.b
      is specified with an unknown group context
              at org.teiid.query.resolver.util.ResolverVisitor.handleUnresolvedElement(ResolverVisitor.java:102)
              at org.teiid.query.resolver.util.ResolverVisitor.internalResolveElementSymbol(ResolverVisitor.java:199)
              at org.teiid.query.resolver.util.ResolverVisitor.resolveElementSymbol(ResolverVisitor.java:135)
              at org.teiid.query.resolver.util.ResolverVisitor.visit(ResolverVisitor.java:90)
              at org.teiid.query.sql.symbol.ElementSymbol.acceptVisitor(ElementSymbol.java:223)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:50)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:57)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.postVisitVisitor(SimpleQueryResolver.java:219)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:167)
              at org.teiid.query.sql.symbol.ElementSymbol.acceptVisitor(ElementSymbol.java:223)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:75)
              at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:86)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:338)
              at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:164)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:237)
              at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:66)
              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:282)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.resolveSubQuery(SimpleQueryResolver.java:283)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:463)
              at org.teiid.query.sql.lang.SubqueryFromClause.acceptVisitor(SubqueryFromClause.java:123)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:593)
              at org.teiid.query.sql.lang.JoinPredicate.acceptVisitor(JoinPredicate.java:175)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:183)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:619)
              at org.teiid.query.sql.lang.From.acceptVisitor(From.java:142)
              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:59)
              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:233)
              at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:66)
              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:282)
              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:128)
              at org.teiid.dqp.internal.process.Request.resolveCommand(Request.java:282)
              at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:418)
              at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
              at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
              at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
              at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
              at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
              at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      The behavior is expected. Lateral is expected to work left to right - thus only with inner/left joins. The error message should be improved. On pgsql it is "The combining JOIN type must be INNER or LEFT for a LATERAL reference".

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

                Created:
                Updated:
                Resolved: