Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-5389

Query error 'reference cc is ambiguous'

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0-alpha
    • 5.0-alpha
    • Query Engine
    • None

    Description

      Root Cause

       

      这个问题由  https://issues.apache.org/jira/browse/KYLIN-5324 引入

      是这个功能特有的问题,只有打开开关 kylin.query.use-tableindex-answer-select-star.enabled=true 时才会遇到。

       

      报错出现在calcite plan转换到spark plan的时候,在解析的时候出现了重复列。重复列是来自打开开关的时候,在使用索引引用的列替换OlapContext的fields的时候没有去重。

       

      org.apache.kylin.query.schema.OLAPTable#listTableColumnsIncludingCC

      1,dataflow的allColumns取的是indexPlan的allColumns属性,这个是很老的代码,包含了衍生维度的逻辑,会把维度、度量引用的列、join key的外键都加进来。

      2,取完模型上的列后再次拿取整个项目下的CC,如果在1里拿到了CC,则会引起重复。这次问题就出在这里。

       

      Fix Design

      在上述代码里去掉重复列。

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jlelehe Jiale He
            jlelehe Jiale He
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment