/** {@inheritDoc} */
  @Override
  public Object getObject(int columnIndex) throws SQLException {
    // to make the logfiles smaller!
    // logger.debug("Function call getObject columnIndex is: " + String.valueOf(columnIndex));
    this.closestrm();
    if (this.isClosed()) {
      throw new BQSQLException("This Resultset is Closed");
    }
    this.ThrowCursorNotValidExeption();
    if (this.RowsofResult == null) {
      throw new BQSQLException("There are no rows in this Resultset");
    }
    if (this.getMetaData().getColumnCount() < columnIndex || columnIndex < 1) {
      throw new BQSQLException("ColumnIndex is not valid");
    }
    String Columntype = this.Result.getSchema().getFields().get(columnIndex - 1).getType();

    TableCell field = ((TableRow) this.RowsofResult[this.Cursor]).getF().get(columnIndex - 1);

    if (Data.isNull(field.getV())) {
      this.wasnull = true;
      return null;
    } else {
      String result = field.getV().toString();
      this.wasnull = false;
      try {
        if (Columntype.equals("STRING")) {
          // removing the excess byte by the setmaxFiledSize
          if (maxFieldSize == 0 || maxFieldSize == Integer.MAX_VALUE) {
            return result;
          } else {
            try { // lets try to remove the excess bytes
              return result.substring(0, maxFieldSize);
            } catch (IndexOutOfBoundsException iout) {
              // we don't need to remove any excess byte
              return result;
            }
          }
        }
        if (Columntype.equals("FLOAT")) {
          return Float.parseFloat(result);
        }
        if (Columntype.equals("BOOLEAN")) {
          return Boolean.parseBoolean(result);
        }
        if (Columntype.equals("INTEGER")) {
          return Long.parseLong(result);
        }
        if (Columntype.equals("TIMESTAMP")) {
          long val = new BigDecimal(result).longValue() * 1000;
          return new Timestamp(val);
        }
        throw new BQSQLException("Unsupported Type (" + Columntype + ")");
      } catch (NumberFormatException e) {
        throw new BQSQLException(e);
      }
    }
  }
 private String generateHash(@Nonnull List<TableRow> rows) {
   List<HashCode> rowHashes = Lists.newArrayList();
   for (TableRow row : rows) {
     List<String> cellsInOneRow = Lists.newArrayList();
     for (TableCell cell : row.getF()) {
       cellsInOneRow.add(Objects.toString(cell.getV()));
       Collections.sort(cellsInOneRow);
     }
     rowHashes.add(Hashing.sha1().hashString(cellsInOneRow.toString(), StandardCharsets.UTF_8));
   }
   return Hashing.combineUnordered(rowHashes).toString();
 }
 private String formatRows(int totalNumRows) {
   StringBuilder samples = new StringBuilder();
   List<TableRow> rows = response.getRows();
   for (int i = 0; i < totalNumRows && i < rows.size(); i++) {
     samples.append(String.format("%n\t\t"));
     for (TableCell field : rows.get(i).getF()) {
       samples.append(String.format("%-10s", field.getV()));
     }
   }
   if (rows.size() > totalNumRows) {
     samples.append(String.format("%n\t\t..."));
   }
   return samples.toString();
 }