Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-1889

UndefinedColumnException when a query with table subquery is executed on self-describing tables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 0.11.0
    • Planner/Optimizer
    • None

    Description

      Here is the log.

      default> select title1, title2, null_expected, sortas, abbrev from (
      select
        glossary.title title1,
        glossary."GlossDiv".title title2,
        glossary."GlossDiv".null_expected null_expected,
        glossary."GlossDiv"."GlossList"."GlossEntry"."SortAs" sortas,
        glossary."GlossDiv"."GlossList"."GlossEntry"."Abbrev" abbrev
      from
        self_desc_table2
        where glossary.title is not null) t
      
      ...
      2015-09-24 18:35:44,833 ERROR: org.apache.tajo.master.GlobalEngine (printStackTrace(188)) - 
      Stack Trace:
      org.apache.tajo.exception.UndefinedColumnException: column 'glossary.title' does not exist
      	at org.apache.tajo.plan.nameresolver.NameResolver.lookupQualifierAndCanonicalName(NameResolver.java:429)
      	at org.apache.tajo.plan.nameresolver.NameResolver.resolveFromRelsWithinBlock(NameResolver.java:162)
      	at org.apache.tajo.plan.nameresolver.ResolverByRels.resolve(ResolverByRels.java:37)
      	at org.apache.tajo.plan.nameresolver.NameResolver.resolve(NameResolver.java:81)
      	at org.apache.tajo.plan.rewrite.BaseSchemaBuildPhase$Processor$NameRefInSelectListNormalizer.visitColumnReference(BaseSchemaBuildPhase.java:581)
      	at org.apache.tajo.plan.rewrite.BaseSchemaBuildPhase$Processor$NameRefInSelectListNormalizer.visitColumnReference(BaseSchemaBuildPhase.java:565)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:225)
      	at org.apache.tajo.plan.visitor.SimpleAlgebraVisitor.visit(SimpleAlgebraVisitor.java:46)
      	at org.apache.tajo.plan.rewrite.BaseSchemaBuildPhase$Processor$NameRefInSelectListNormalizer.normalize(BaseSchemaBuildPhase.java:574)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitFilter(SelfDescSchemaBuildPhase.java:248)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitFilter(SelfDescSchemaBuildPhase.java:153)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:78)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visitProjection(BaseAlgebraVisitor.java:319)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitProjection(SelfDescSchemaBuildPhase.java:180)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitProjection(SelfDescSchemaBuildPhase.java:153)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:60)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visitTableSubQuery(BaseAlgebraVisitor.java:419)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitTableSubQuery(SelfDescSchemaBuildPhase.java:319)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitTableSubQuery(SelfDescSchemaBuildPhase.java:153)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:93)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visitRelationList(BaseAlgebraVisitor.java:429)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:96)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visitProjection(BaseAlgebraVisitor.java:319)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitProjection(SelfDescSchemaBuildPhase.java:180)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase$Processor.visitProjection(SelfDescSchemaBuildPhase.java:153)
      	at org.apache.tajo.plan.algebra.BaseAlgebraVisitor.visit(BaseAlgebraVisitor.java:60)
      	at org.apache.tajo.plan.rewrite.SelfDescSchemaBuildPhase.process(SelfDescSchemaBuildPhase.java:141)
      	at org.apache.tajo.plan.rewrite.BaseLogicalPlanPreprocessEngine.process(BaseLogicalPlanPreprocessEngine.java:94)
      	at org.apache.tajo.plan.LogicalPlanPreprocessor.process(LogicalPlanPreprocessor.java:43)
      	at org.apache.tajo.plan.LogicalPlanner.createPlan(LogicalPlanner.java:167)
      	at org.apache.tajo.plan.LogicalPlanner.createPlan(LogicalPlanner.java:157)
      	at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:274)
      	at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:190)
      

      Attachments

        1. TAJO-1889_wrong_query.patch
          0.7 kB
          Jihoon Son
        2. TAJO-1889.patch
          8 kB
          Jihoon Son

        Activity

          People

            jihoonson Jihoon Son
            jihoonson Jihoon Son
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: