docs: public String toFormattedString(boolean includeColumnNames) {
  
          final int MAX_PRINTABLE_CHARS = 30;
          // chose print width for geography column such that it can print polygon in
          // aligned manner with geography column for a polygon up to:
          // a polygon composed of 4 vertices + 1 repeat vertex,
          // one ring, each coordinate of vertex having 5 digits space including the sign of lng/lat
          final int MAX_PRINTABLE_CHARS_GEOGRAPHY = 74;
  
          final String ELLIPSIS = "...";
          final String DECIMAL_FORMAT = "%01.12f";
  
          StringBuffer sb = new StringBuffer();
  
          int columnCount = getColumnCount();
          int[] padding = new int[columnCount];
          String[] fmt = new String[columnCount];
          // start with minimum padding based on length of column names. this gets
          // increased later as needed
          for (int i = 0; i < columnCount; i++) {
              padding[i] = getColumnName(i).length(); // min value to be increased later
          }
          resetRowPosition();
  
          // Compute the padding needed for each column of the table (note: must
          // visit every row)
          while (advanceRow()) {
              for (int i = 0; i < columnCount; i++) {
                  VoltType colType = getColumnType(i);
                  Object value = get(i, colType);
                  int width;
                  if (wasNull()) {
                      width = 4;
                  }
                  else if (colType == VoltType.DECIMAL) {
                      BigDecimal bd = (BigDecimal) value;
                      String valueStr = String.format(DECIMAL_FORMAT, bd.doubleValue());
                      width = valueStr.length();
                  }
                  // crop long strings and such
                  else {
                      if (colType == VoltType.VARBINARY) {
                          width = ((byte[]) value).length * 2;
                      }
                      else {
                          width = value.toString().length();
                      }
                      if ( ((colType == VoltType.GEOGRAPHY) && (width > MAX_PRINTABLE_CHARS_GEOGRAPHY)) ||
                           ((colType != VoltType.GEOGRAPHY) && (width > MAX_PRINTABLE_CHARS)) ) {
                          width = (colType == VoltType.GEOGRAPHY) ? MAX_PRINTABLE_CHARS_GEOGRAPHY : MAX_PRINTABLE_CHARS;
                      }
                  }
  
                  // Adjust the max width for each column
                  if (width > padding[i]) {
                      padding[i] = width;
                  }
              }
          }
  
          String pad = ""; // no pad before first column header.
          // calculate formating space based on columns.
          // Append column names and separator line to buffer
          for (int i = 0; i < columnCount; i++) {
              padding[i] += 1;
              // Determine the formatting string for each column
              VoltType colType = getColumnType(i);
              String justification = (colType.isVariableLength() ||
                      colType == VoltType.TIMESTAMP ||
                      colType == VoltType.GEOGRAPHY_POINT) ? "-" : "";
              fmt[i] = "%1$" + justification + padding[i] + "s";
  
              if (includeColumnNames) {
                  // Serialize the column headers
                  sb.append(pad).append(String.format("%1$-" + padding[i] + "s",
                          getColumnName(i)));
                  pad = " ";
              }
          }
  
          if (includeColumnNames) {
              // construct separator to be used between column name header and table values
              sb.append("\n");
  
              // Serialize the separator between the column headers and the rows of data
              pad = "";
              for (int i = 0; i < columnCount; i++) {
                  char[] underline_array = new char[padding[i]];
                  Arrays.fill(underline_array, '-');
                  sb.append(pad).append(new String(underline_array));
                  pad = " ";
              }
              sb.append("\n");
          }
  
          // Serialize each formatted row of data.
          resetRowPosition();
          while (advanceRow()) {
              pad = "";
              for (int i = 0; i < columnCount; i++) {
                  VoltType colType = getColumnType(i);
                  Object value = get(i, colType);
                  String valueStr;
                  if (wasNull()) {
                      valueStr = "NULL";
                  }
                  else if (colType == VoltType.DECIMAL) {
                      BigDecimal bd = (BigDecimal) value;
                      valueStr = String.format(DECIMAL_FORMAT, bd.doubleValue());
                  }
                  else {
                      if (colType == VoltType.VARBINARY) {
                          valueStr = Encoder.hexEncode((byte[]) value);
                          // crop long varbinaries
                          if (valueStr.length() > MAX_PRINTABLE_CHARS) {
                              valueStr = valueStr.substring(0, MAX_PRINTABLE_CHARS - ELLIPSIS.length()) + ELLIPSIS;
                          }
                      }
                      else {
                          valueStr = value.toString();
                      }
                  }
                  sb.append(pad).append(String.format(fmt[i], valueStr));
                  pad = " ";
              }
              sb.append("\n");
          }
  
          // Idempotent. Reset the row position for the next guy...
          resetRowPosition();
  
          return sb.toString();
      }