private static String getStringByColumnIndex(
      IoTDBJDBCResultSet resultSet, int columnIndex, ZoneId zoneId) throws SQLException {
    TSDataType type = resultSet.getColumnTypeByIndex(columnIndex);
    switch (type) {
      case BOOLEAN:
      case INT32:
      case INT64:
      case FLOAT:
      case DOUBLE:
      case TEXT:
      case STRING:
        return resultSet.getString(columnIndex);
      case BLOB:
        byte[] v = resultSet.getBytes(columnIndex);
        if (v == null) {
          return null;
        } else {
          return BytesUtils.parseBlobByteArrayToString(v);
        }
      case DATE:
        int intValue = resultSet.getInt(columnIndex);
        if (resultSet.wasNull()) {
          return null;
        } else {
          return DateUtils.formatDate(intValue);
        }
      case TIMESTAMP:
        long longValue = resultSet.getLong(columnIndex);
        if (resultSet.wasNull()) {
          return null;
        } else {
          return RpcUtils.formatDatetime(timeFormat, timestampPrecision, longValue, zoneId);
        }
      default:
        return null;
    }
  }
Cache all results.

@param resultSet jdbc resultSet
@param maxSizeList the longest result of every column
@param columnCount the number of column
@param resultSetMetaData jdbc resultSetMetaData
@param zoneId your time zone
@return {@literal List<List<String>> result}
@throws SQLException throw exception
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java