private List<Mutation> getIndexMutations(Mutation baseMut) {
      List indexMuts = new ArrayList<Mutation>();

      // nothing to do if there is not a index definition for this table
      if (null != indexDef) {

        byte[] rowId = baseMut.getRow();


        for (ColumnUpdate cu : baseMut.getUpdates()) {
          String cf = new String(cu.getColumnFamily());
          String cq = new String(cu.getColumnQualifier());

          // if this columnFamily/columnQualifier pair is defined in the index build a new mutation
          // so key=value, cf=columnFamily_columnQualifer, cq=rowKey, cv=columnVisibility value=[]
          String colType = indexDef.getColType(cf, cq);
          if (colType != null) {
            LOG.trace("Building index for column {}:{}", cf, cq);
            Mutation m = new Mutation(AccumuloIndexLexicoder.encodeValue(cu.getValue(), colType,
                                               isStringEncoded));
            String colFam = cf + "_" + cq;
            m.put(colFam.getBytes(), rowId, new ColumnVisibility(cu.getColumnVisibility()),
                  EMPTY_BYTES);
            indexMuts.add(m);
          }
        }
      }
      return indexMuts;
    }
Extension of AccumuloOutputFormat to support indexing.
accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/mr/AccumuloIndexedOutputFormat.java