Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1535

Secondary local index casues Undefined column error with queries involving joins

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.0
    • 4.3.0
    • None
    • None
    • HBase 0.98.6; CDH-5.2.0-1.cdh5.2.0.p0.36

    Description

      Create 2 tables with a local index
      create table tab1 (col1 bigint, col2 bigint, col3 bigint, constraint pk_tab1 primary key (col1));
      create table tab2 (col1 bigint, col2 bigint, col3 bigint, constraint pk_tab1 primary key (col1));
      create local index ind_tab1 on tab1(col2);

      Executing a query with a condition on the local index column and select a column not in the index results in an error:
      explain
      select tab1.col3
      from tab1 join tab2 on tab1.col1 = tab2.col1
      where tab1.col2 = 1
      =======
      Error: ERROR 504 (42703): Undefined column. columnName=0:COL3
      SQLState: 42703
      ErrorCode: 504
      =======

      Select * is ok:
      explain select tab1.* from tab1 where tab1.col2 = 1

      If I drop the local index, the first query runs successfully.

      Attachments

        1. PHOENIX-1535.v4.patch
          106 kB
          Rajeshbabu Chintaguntla
        2. PHOENIX-1535.v3.patch
          106 kB
          James R. Taylor
        3. 1535.v2.patch
          106 kB
          Wei Xue
        4. 1535.patch
          71 kB
          Wei Xue
        5. 1535.incomplete.patch
          43 kB
          Wei Xue

        Issue Links

          Activity

            People

              maryannxue Wei Xue
              joycelau1 Joyce Lau
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: