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

Fix tableName used to get the index maintainers while creating HalfStoreFileReader for local index store

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.10.0
    • Labels:
      None

      Description

      Physical Tablename is used instead of phoenix table name . IndexHalfStoreFileReaderGenerator#preStoreFileReaderOpen

      TableName tableName = ctx.getEnvironment().getRegion().getTableDesc().getTableName();
      ..............
      try {
      
      
                      conn = 
      QueryUtil.getConnectionOnServer(ctx.getEnvironment().getConfiguration()).unwrap(
                                  PhoenixConnection.class);
                      PTable dataTable = PhoenixRuntime.getTableNoCache(conn, tableName.getNameAsString());
                      List<PTable> indexes = dataTable.getIndexes();
                      Map<ImmutableBytesWritable, IndexMaintainer> indexMaintainers =
                              new HashMap<ImmutableBytesWritable, IndexMaintainer>();
                      for (PTable index : indexes) {
                          if (index.getIndexType() == IndexType.LOCAL) {
                              IndexMaintainer indexMaintainer = index.getIndexMaintainer(dataTable, conn);
                              indexMaintainers.put(new ImmutableBytesWritable(MetaDataUtil
                                      .getViewIndexIdDataType().toBytes(index.getViewIndexId())),
                                  indexMaintainer);
                          }
                      }
                      if(indexMaintainers.isEmpty()) return reader;
                      byte[][] viewConstants = getViewConstants(dataTable);
                      return new IndexHalfStoreFileReader(fs, p, cacheConf, in, size, r, ctx
                              .getEnvironment().getConfiguration(), indexMaintainers, viewConstants,
                              childRegion, regionStartKeyInHFile, splitKey);
      

        Attachments

        1. PHOENIX-3610_v1.patch
          6 kB
          Ankit Singhal
        2. PHOENIX-3610.patch
          7 kB
          Ankit Singhal

          Activity

            People

            • Assignee:
              ankit@apache.org Ankit Singhal
              Reporter:
              ankit@apache.org Ankit Singhal
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: