Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-1912

When adding a secondary index to an existing table, it will cause NPE during re-indexing.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.20.0, 0.20.1
    • 0.20.2, 0.90.0
    • None
    • None

    Description

      When adding a secondary index to an existing table, an IndexSpecification must be constructed.
      If we construct a simple index using the following constructor: IndexSpecification(String indexId, byte[] indexedColumn), then the program will cause NPE during re-indexing.

      Exception in thread "main" java.lang.NullPointerException
      at org.apache.hadoop.hbase.regionserver.tableindexed.IndexMaintenanceUtils.createIndexUpdate(IndexMaintenanceUtils.java:57)
      at org.apache.hadoop.hbase.client.tableindexed.IndexedTableAdmin.reIndexTable(IndexedTableAdmin.java:144)
      at org.apache.hadoop.hbase.client.tableindexed.IndexedTableAdmin.addIndex(IndexedTableAdmin.java:132)
      at MyIndexedTable.addSecondaryIndexToExistingTable(MyIndexedTable.java:256)
      at MyIndexedTable.main(MyIndexedTable.java:276)

      Attachments

        1. IndexSpecification.patch
          0.7 kB
          Mingjui Ray Liao
        2. hbase-site.xml
          21 kB
          Mingjui Ray Liao
        3. IndexedTableTest.java
          4 kB
          Mingjui Ray Liao

        Activity

          People

            Unassigned Unassigned
            ray_liao Mingjui Ray Liao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: