docs: @Override
      public VoltXMLElement voltGetIndexXML(Session session, String tableName,
              Map<String, VoltXMLElement> indexConstraintMapping)
                      throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException {
          org.hsqldb_voltpatches.VoltXMLElement index = new org.hsqldb_voltpatches.VoltXMLElement("index");
  
          // Add any expressions to the XML representation of the index,
          // and compute a hash that will help uniquify the generated name,
          // if a name was not provided.
          int exprHash = 0;
          if (exprs != null) {
              org.hsqldb_voltpatches.VoltXMLElement indexedExprs = new org.hsqldb_voltpatches.VoltXMLElement("exprs");
              index.children.add(indexedExprs);
              String hashExprString = new String();
              String sep = "";
              for (org.hsqldb_voltpatches.Expression expression : exprs) {
                  org.hsqldb_voltpatches.VoltXMLElement xml = expression.voltGetExpressionXML(session, (Table) table);
                  indexedExprs.children.add(xml);
                  hashExprString += sep + expression.getSQL();
                  sep = ",";
              }
  
              byte[] bytes = hashExprString.getBytes();
              for (int ii = 0; ii < bytes.length; ii++) {
                  exprHash = 31 * exprHash + bytes[ii];
              }
          }
  
          String hsqlIndexName = getName().name;
          String voltdbIndexName = null;
          boolean isHashIndex = false;
  
          if (indexConstraintMapping.containsKey(hsqlIndexName)) {
              // This is an index backing a constraint.
              VoltXMLElement constraintXml = indexConstraintMapping.get(hsqlIndexName);
              indexConstraintMapping.remove(hsqlIndexName);
  
              boolean isAutoName = constraintXml.attributes.get("nameisauto").equals("true");
  
              // This is either a [ASSUME]UNIQUE constraint or a PK.
              String constraintType = constraintXml.attributes.get("constrainttype");
              String hsqlConstraintName = constraintXml.attributes.get("name");
  
              if (!isAutoName) {
                  isHashIndex = isNameRequestingHashIndex(hsqlConstraintName);
                  voltdbIndexName = HSQLInterface.AUTO_GEN_NAMED_CONSTRAINT_IDX + hsqlConstraintName;
              }
              else {
                  String prefix = null;
                  boolean isPrimaryKey = constraintType.equals("PRIMARY_KEY");
                  if (isPrimaryKey) {
                      prefix = HSQLInterface.AUTO_GEN_PRIMARY_KEY_PREFIX;
                  }
                  else {
                      prefix = HSQLInterface.AUTO_GEN_UNIQUE_IDX_PREFIX;
                  }
  
                  String namePart = tableName + "_" + StringUtils.join(getColumnNameList().toArray(), "_");
                  if (exprs != null) {
                      namePart += "_" + java.lang.Math.abs(exprHash % 100000);
                  }
  
                  voltdbIndexName = prefix + namePart;
  
                  // Also name the constraint here based on our naming scheme.
                  String voltdbConstraintName = null;
                  if (isPrimaryKey) {
                      voltdbConstraintName = HSQLInterface.AUTO_GEN_CONSTRAINT_PREFIX + "_PK_" + namePart;
                  }
                  else {
                      voltdbConstraintName = HSQLInterface.AUTO_GEN_CONSTRAINT_PREFIX + "_CT_" + namePart;
  
                  }
  
                  constraintXml.attributes.put("name", voltdbConstraintName);
              }
  
              // Update the index name in the constraint.
              constraintXml.attributes.put("index", voltdbIndexName);
          }
          else {
              // This is an index created via CREATE INDEX
              isHashIndex = isNameRequestingHashIndex(hsqlIndexName);
              voltdbIndexName = hsqlIndexName;
          }
  
          index.attributes.put("name", voltdbIndexName);
          index.attributes.put("ishashindex", isHashIndex ? "true" : "false");
  
          index.attributes.put("assumeunique", isAssumeUnique() ? "true" : "false");
          index.attributes.put("unique", isUnique() ? "true" : "false");
          index.attributes.put("migrating", isMigrating() ? "true" : "false");
          assert ! (isMigrating() && (isUnique() || isAssumeUnique())) :
                  "Cannot create a MIGRATING index that is also UNIQUE or ASSUMEUNIQUE";
  
          Object[] columnList = getColumnNameList().toArray();
          index.attributes.put("columns", StringUtils.join(columnList, ","));
  
          if (predicate != null) {
              org.hsqldb_voltpatches.VoltXMLElement partialExpr = new org.hsqldb_voltpatches.VoltXMLElement("predicate");
              index.children.add(partialExpr);
              org.hsqldb_voltpatches.VoltXMLElement xml = predicate.voltGetExpressionXML(session, (Table) table);
              partialExpr.children.add(xml);
          }
  
          return index;
      }