TQueryStatistics.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TQueryStatistics implements org.apache.thrift.TBase<TQueryStatistics, TQueryStatistics._Fields>, java.io.Serializable, Cloneable, Comparable<TQueryStatistics> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TQueryStatistics");

  private static final org.apache.thrift.protocol.TField SCAN_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("scan_rows", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField SCAN_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("scan_bytes", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField RETURNED_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("returned_rows", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField CPU_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu_ms", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField MAX_PEAK_MEMORY_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("max_peak_memory_bytes", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField CURRENT_USED_MEMORY_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("current_used_memory_bytes", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField WORKLOAD_GROUP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workload_group_id", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField SHUFFLE_SEND_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffle_send_bytes", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField SHUFFLE_SEND_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffle_send_rows", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField SCAN_BYTES_FROM_LOCAL_STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("scan_bytes_from_local_storage", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField SCAN_BYTES_FROM_REMOTE_STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("scan_bytes_from_remote_storage", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("spill_write_bytes_to_local_storage", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField SPILL_READ_BYTES_FROM_LOCAL_STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("spill_read_bytes_from_local_storage", org.apache.thrift.protocol.TType.I64, (short)13);
  private static final org.apache.thrift.protocol.TField BYTES_WRITE_INTO_CACHE_FIELD_DESC = new org.apache.thrift.protocol.TField("bytes_write_into_cache", org.apache.thrift.protocol.TType.I64, (short)14);
  private static final org.apache.thrift.protocol.TField PROCESS_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("process_rows", org.apache.thrift.protocol.TType.I64, (short)15);
  private static final org.apache.thrift.protocol.TField FINISHED_TASKS_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("finished_tasks_num", org.apache.thrift.protocol.TType.I32, (short)16);
  private static final org.apache.thrift.protocol.TField TOTAL_TASKS_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("total_tasks_num", org.apache.thrift.protocol.TType.I32, (short)17);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TQueryStatisticsStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TQueryStatisticsTupleSchemeFactory();

  public long scan_rows; // optional
  public long scan_bytes; // optional
  public long returned_rows; // optional
  public long cpu_ms; // optional
  public long max_peak_memory_bytes; // optional
  public long current_used_memory_bytes; // optional
  public long workload_group_id; // optional
  public long shuffle_send_bytes; // optional
  public long shuffle_send_rows; // optional
  public long scan_bytes_from_local_storage; // optional
  public long scan_bytes_from_remote_storage; // optional
  public long spill_write_bytes_to_local_storage; // optional
  public long spill_read_bytes_from_local_storage; // optional
  public long bytes_write_into_cache; // optional
  public long process_rows; // optional
  public int finished_tasks_num; // optional
  public int total_tasks_num; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    SCAN_ROWS((short)1, "scan_rows"),
    SCAN_BYTES((short)2, "scan_bytes"),
    RETURNED_ROWS((short)3, "returned_rows"),
    CPU_MS((short)4, "cpu_ms"),
    MAX_PEAK_MEMORY_BYTES((short)5, "max_peak_memory_bytes"),
    CURRENT_USED_MEMORY_BYTES((short)6, "current_used_memory_bytes"),
    WORKLOAD_GROUP_ID((short)7, "workload_group_id"),
    SHUFFLE_SEND_BYTES((short)8, "shuffle_send_bytes"),
    SHUFFLE_SEND_ROWS((short)9, "shuffle_send_rows"),
    SCAN_BYTES_FROM_LOCAL_STORAGE((short)10, "scan_bytes_from_local_storage"),
    SCAN_BYTES_FROM_REMOTE_STORAGE((short)11, "scan_bytes_from_remote_storage"),
    SPILL_WRITE_BYTES_TO_LOCAL_STORAGE((short)12, "spill_write_bytes_to_local_storage"),
    SPILL_READ_BYTES_FROM_LOCAL_STORAGE((short)13, "spill_read_bytes_from_local_storage"),
    BYTES_WRITE_INTO_CACHE((short)14, "bytes_write_into_cache"),
    PROCESS_ROWS((short)15, "process_rows"),
    FINISHED_TASKS_NUM((short)16, "finished_tasks_num"),
    TOTAL_TASKS_NUM((short)17, "total_tasks_num");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // SCAN_ROWS
          return SCAN_ROWS;
        case 2: // SCAN_BYTES
          return SCAN_BYTES;
        case 3: // RETURNED_ROWS
          return RETURNED_ROWS;
        case 4: // CPU_MS
          return CPU_MS;
        case 5: // MAX_PEAK_MEMORY_BYTES
          return MAX_PEAK_MEMORY_BYTES;
        case 6: // CURRENT_USED_MEMORY_BYTES
          return CURRENT_USED_MEMORY_BYTES;
        case 7: // WORKLOAD_GROUP_ID
          return WORKLOAD_GROUP_ID;
        case 8: // SHUFFLE_SEND_BYTES
          return SHUFFLE_SEND_BYTES;
        case 9: // SHUFFLE_SEND_ROWS
          return SHUFFLE_SEND_ROWS;
        case 10: // SCAN_BYTES_FROM_LOCAL_STORAGE
          return SCAN_BYTES_FROM_LOCAL_STORAGE;
        case 11: // SCAN_BYTES_FROM_REMOTE_STORAGE
          return SCAN_BYTES_FROM_REMOTE_STORAGE;
        case 12: // SPILL_WRITE_BYTES_TO_LOCAL_STORAGE
          return SPILL_WRITE_BYTES_TO_LOCAL_STORAGE;
        case 13: // SPILL_READ_BYTES_FROM_LOCAL_STORAGE
          return SPILL_READ_BYTES_FROM_LOCAL_STORAGE;
        case 14: // BYTES_WRITE_INTO_CACHE
          return BYTES_WRITE_INTO_CACHE;
        case 15: // PROCESS_ROWS
          return PROCESS_ROWS;
        case 16: // FINISHED_TASKS_NUM
          return FINISHED_TASKS_NUM;
        case 17: // TOTAL_TASKS_NUM
          return TOTAL_TASKS_NUM;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __SCAN_ROWS_ISSET_ID = 0;
  private static final int __SCAN_BYTES_ISSET_ID = 1;
  private static final int __RETURNED_ROWS_ISSET_ID = 2;
  private static final int __CPU_MS_ISSET_ID = 3;
  private static final int __MAX_PEAK_MEMORY_BYTES_ISSET_ID = 4;
  private static final int __CURRENT_USED_MEMORY_BYTES_ISSET_ID = 5;
  private static final int __WORKLOAD_GROUP_ID_ISSET_ID = 6;
  private static final int __SHUFFLE_SEND_BYTES_ISSET_ID = 7;
  private static final int __SHUFFLE_SEND_ROWS_ISSET_ID = 8;
  private static final int __SCAN_BYTES_FROM_LOCAL_STORAGE_ISSET_ID = 9;
  private static final int __SCAN_BYTES_FROM_REMOTE_STORAGE_ISSET_ID = 10;
  private static final int __SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_ISSET_ID = 11;
  private static final int __SPILL_READ_BYTES_FROM_LOCAL_STORAGE_ISSET_ID = 12;
  private static final int __BYTES_WRITE_INTO_CACHE_ISSET_ID = 13;
  private static final int __PROCESS_ROWS_ISSET_ID = 14;
  private static final int __FINISHED_TASKS_NUM_ISSET_ID = 15;
  private static final int __TOTAL_TASKS_NUM_ISSET_ID = 16;
  private int __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SCAN_ROWS,_Fields.SCAN_BYTES,_Fields.RETURNED_ROWS,_Fields.CPU_MS,_Fields.MAX_PEAK_MEMORY_BYTES,_Fields.CURRENT_USED_MEMORY_BYTES,_Fields.WORKLOAD_GROUP_ID,_Fields.SHUFFLE_SEND_BYTES,_Fields.SHUFFLE_SEND_ROWS,_Fields.SCAN_BYTES_FROM_LOCAL_STORAGE,_Fields.SCAN_BYTES_FROM_REMOTE_STORAGE,_Fields.SPILL_WRITE_BYTES_TO_LOCAL_STORAGE,_Fields.SPILL_READ_BYTES_FROM_LOCAL_STORAGE,_Fields.BYTES_WRITE_INTO_CACHE,_Fields.PROCESS_ROWS,_Fields.FINISHED_TASKS_NUM,_Fields.TOTAL_TASKS_NUM};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.SCAN_ROWS, new org.apache.thrift.meta_data.FieldMetaData("scan_rows", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SCAN_BYTES, new org.apache.thrift.meta_data.FieldMetaData("scan_bytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.RETURNED_ROWS, new org.apache.thrift.meta_data.FieldMetaData("returned_rows", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CPU_MS, new org.apache.thrift.meta_data.FieldMetaData("cpu_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAX_PEAK_MEMORY_BYTES, new org.apache.thrift.meta_data.FieldMetaData("max_peak_memory_bytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CURRENT_USED_MEMORY_BYTES, new org.apache.thrift.meta_data.FieldMetaData("current_used_memory_bytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.WORKLOAD_GROUP_ID, new org.apache.thrift.meta_data.FieldMetaData("workload_group_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SHUFFLE_SEND_BYTES, new org.apache.thrift.meta_data.FieldMetaData("shuffle_send_bytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SHUFFLE_SEND_ROWS, new org.apache.thrift.meta_data.FieldMetaData("shuffle_send_rows", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SCAN_BYTES_FROM_LOCAL_STORAGE, new org.apache.thrift.meta_data.FieldMetaData("scan_bytes_from_local_storage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SCAN_BYTES_FROM_REMOTE_STORAGE, new org.apache.thrift.meta_data.FieldMetaData("scan_bytes_from_remote_storage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SPILL_WRITE_BYTES_TO_LOCAL_STORAGE, new org.apache.thrift.meta_data.FieldMetaData("spill_write_bytes_to_local_storage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SPILL_READ_BYTES_FROM_LOCAL_STORAGE, new org.apache.thrift.meta_data.FieldMetaData("spill_read_bytes_from_local_storage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.BYTES_WRITE_INTO_CACHE, new org.apache.thrift.meta_data.FieldMetaData("bytes_write_into_cache", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PROCESS_ROWS, new org.apache.thrift.meta_data.FieldMetaData("process_rows", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.FINISHED_TASKS_NUM, new org.apache.thrift.meta_data.FieldMetaData("finished_tasks_num", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.TOTAL_TASKS_NUM, new org.apache.thrift.meta_data.FieldMetaData("total_tasks_num", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TQueryStatistics.class, metaDataMap);
  }

  public TQueryStatistics() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TQueryStatistics(TQueryStatistics other) {
    __isset_bitfield = other.__isset_bitfield;
    this.scan_rows = other.scan_rows;
    this.scan_bytes = other.scan_bytes;
    this.returned_rows = other.returned_rows;
    this.cpu_ms = other.cpu_ms;
    this.max_peak_memory_bytes = other.max_peak_memory_bytes;
    this.current_used_memory_bytes = other.current_used_memory_bytes;
    this.workload_group_id = other.workload_group_id;
    this.shuffle_send_bytes = other.shuffle_send_bytes;
    this.shuffle_send_rows = other.shuffle_send_rows;
    this.scan_bytes_from_local_storage = other.scan_bytes_from_local_storage;
    this.scan_bytes_from_remote_storage = other.scan_bytes_from_remote_storage;
    this.spill_write_bytes_to_local_storage = other.spill_write_bytes_to_local_storage;
    this.spill_read_bytes_from_local_storage = other.spill_read_bytes_from_local_storage;
    this.bytes_write_into_cache = other.bytes_write_into_cache;
    this.process_rows = other.process_rows;
    this.finished_tasks_num = other.finished_tasks_num;
    this.total_tasks_num = other.total_tasks_num;
  }

  public TQueryStatistics deepCopy() {
    return new TQueryStatistics(this);
  }

  @Override
  public void clear() {
    setScanRowsIsSet(false);
    this.scan_rows = 0;
    setScanBytesIsSet(false);
    this.scan_bytes = 0;
    setReturnedRowsIsSet(false);
    this.returned_rows = 0;
    setCpuMsIsSet(false);
    this.cpu_ms = 0;
    setMaxPeakMemoryBytesIsSet(false);
    this.max_peak_memory_bytes = 0;
    setCurrentUsedMemoryBytesIsSet(false);
    this.current_used_memory_bytes = 0;
    setWorkloadGroupIdIsSet(false);
    this.workload_group_id = 0;
    setShuffleSendBytesIsSet(false);
    this.shuffle_send_bytes = 0;
    setShuffleSendRowsIsSet(false);
    this.shuffle_send_rows = 0;
    setScanBytesFromLocalStorageIsSet(false);
    this.scan_bytes_from_local_storage = 0;
    setScanBytesFromRemoteStorageIsSet(false);
    this.scan_bytes_from_remote_storage = 0;
    setSpillWriteBytesToLocalStorageIsSet(false);
    this.spill_write_bytes_to_local_storage = 0;
    setSpillReadBytesFromLocalStorageIsSet(false);
    this.spill_read_bytes_from_local_storage = 0;
    setBytesWriteIntoCacheIsSet(false);
    this.bytes_write_into_cache = 0;
    setProcessRowsIsSet(false);
    this.process_rows = 0;
    setFinishedTasksNumIsSet(false);
    this.finished_tasks_num = 0;
    setTotalTasksNumIsSet(false);
    this.total_tasks_num = 0;
  }

  public long getScanRows() {
    return this.scan_rows;
  }

  public TQueryStatistics setScanRows(long scan_rows) {
    this.scan_rows = scan_rows;
    setScanRowsIsSet(true);
    return this;
  }

  public void unsetScanRows() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCAN_ROWS_ISSET_ID);
  }

  /** Returns true if field scan_rows is set (has been assigned a value) and false otherwise */
  public boolean isSetScanRows() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCAN_ROWS_ISSET_ID);
  }

  public void setScanRowsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCAN_ROWS_ISSET_ID, value);
  }

  public long getScanBytes() {
    return this.scan_bytes;
  }

  public TQueryStatistics setScanBytes(long scan_bytes) {
    this.scan_bytes = scan_bytes;
    setScanBytesIsSet(true);
    return this;
  }

  public void unsetScanBytes() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCAN_BYTES_ISSET_ID);
  }

  /** Returns true if field scan_bytes is set (has been assigned a value) and false otherwise */
  public boolean isSetScanBytes() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCAN_BYTES_ISSET_ID);
  }

  public void setScanBytesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCAN_BYTES_ISSET_ID, value);
  }

  public long getReturnedRows() {
    return this.returned_rows;
  }

  public TQueryStatistics setReturnedRows(long returned_rows) {
    this.returned_rows = returned_rows;
    setReturnedRowsIsSet(true);
    return this;
  }

  public void unsetReturnedRows() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RETURNED_ROWS_ISSET_ID);
  }

  /** Returns true if field returned_rows is set (has been assigned a value) and false otherwise */
  public boolean isSetReturnedRows() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RETURNED_ROWS_ISSET_ID);
  }

  public void setReturnedRowsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RETURNED_ROWS_ISSET_ID, value);
  }

  public long getCpuMs() {
    return this.cpu_ms;
  }

  public TQueryStatistics setCpuMs(long cpu_ms) {
    this.cpu_ms = cpu_ms;
    setCpuMsIsSet(true);
    return this;
  }

  public void unsetCpuMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CPU_MS_ISSET_ID);
  }

  /** Returns true if field cpu_ms is set (has been assigned a value) and false otherwise */
  public boolean isSetCpuMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CPU_MS_ISSET_ID);
  }

  public void setCpuMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CPU_MS_ISSET_ID, value);
  }

  public long getMaxPeakMemoryBytes() {
    return this.max_peak_memory_bytes;
  }

  public TQueryStatistics setMaxPeakMemoryBytes(long max_peak_memory_bytes) {
    this.max_peak_memory_bytes = max_peak_memory_bytes;
    setMaxPeakMemoryBytesIsSet(true);
    return this;
  }

  public void unsetMaxPeakMemoryBytes() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAX_PEAK_MEMORY_BYTES_ISSET_ID);
  }

  /** Returns true if field max_peak_memory_bytes is set (has been assigned a value) and false otherwise */
  public boolean isSetMaxPeakMemoryBytes() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAX_PEAK_MEMORY_BYTES_ISSET_ID);
  }

  public void setMaxPeakMemoryBytesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAX_PEAK_MEMORY_BYTES_ISSET_ID, value);
  }

  public long getCurrentUsedMemoryBytes() {
    return this.current_used_memory_bytes;
  }

  public TQueryStatistics setCurrentUsedMemoryBytes(long current_used_memory_bytes) {
    this.current_used_memory_bytes = current_used_memory_bytes;
    setCurrentUsedMemoryBytesIsSet(true);
    return this;
  }

  public void unsetCurrentUsedMemoryBytes() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CURRENT_USED_MEMORY_BYTES_ISSET_ID);
  }

  /** Returns true if field current_used_memory_bytes is set (has been assigned a value) and false otherwise */
  public boolean isSetCurrentUsedMemoryBytes() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CURRENT_USED_MEMORY_BYTES_ISSET_ID);
  }

  public void setCurrentUsedMemoryBytesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CURRENT_USED_MEMORY_BYTES_ISSET_ID, value);
  }

  public long getWorkloadGroupId() {
    return this.workload_group_id;
  }

  public TQueryStatistics setWorkloadGroupId(long workload_group_id) {
    this.workload_group_id = workload_group_id;
    setWorkloadGroupIdIsSet(true);
    return this;
  }

  public void unsetWorkloadGroupId() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __WORKLOAD_GROUP_ID_ISSET_ID);
  }

  /** Returns true if field workload_group_id is set (has been assigned a value) and false otherwise */
  public boolean isSetWorkloadGroupId() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __WORKLOAD_GROUP_ID_ISSET_ID);
  }

  public void setWorkloadGroupIdIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WORKLOAD_GROUP_ID_ISSET_ID, value);
  }

  public long getShuffleSendBytes() {
    return this.shuffle_send_bytes;
  }

  public TQueryStatistics setShuffleSendBytes(long shuffle_send_bytes) {
    this.shuffle_send_bytes = shuffle_send_bytes;
    setShuffleSendBytesIsSet(true);
    return this;
  }

  public void unsetShuffleSendBytes() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SHUFFLE_SEND_BYTES_ISSET_ID);
  }

  /** Returns true if field shuffle_send_bytes is set (has been assigned a value) and false otherwise */
  public boolean isSetShuffleSendBytes() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SHUFFLE_SEND_BYTES_ISSET_ID);
  }

  public void setShuffleSendBytesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SHUFFLE_SEND_BYTES_ISSET_ID, value);
  }

  public long getShuffleSendRows() {
    return this.shuffle_send_rows;
  }

  public TQueryStatistics setShuffleSendRows(long shuffle_send_rows) {
    this.shuffle_send_rows = shuffle_send_rows;
    setShuffleSendRowsIsSet(true);
    return this;
  }

  public void unsetShuffleSendRows() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SHUFFLE_SEND_ROWS_ISSET_ID);
  }

  /** Returns true if field shuffle_send_rows is set (has been assigned a value) and false otherwise */
  public boolean isSetShuffleSendRows() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SHUFFLE_SEND_ROWS_ISSET_ID);
  }

  public void setShuffleSendRowsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SHUFFLE_SEND_ROWS_ISSET_ID, value);
  }

  public long getScanBytesFromLocalStorage() {
    return this.scan_bytes_from_local_storage;
  }

  public TQueryStatistics setScanBytesFromLocalStorage(long scan_bytes_from_local_storage) {
    this.scan_bytes_from_local_storage = scan_bytes_from_local_storage;
    setScanBytesFromLocalStorageIsSet(true);
    return this;
  }

  public void unsetScanBytesFromLocalStorage() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCAN_BYTES_FROM_LOCAL_STORAGE_ISSET_ID);
  }

  /** Returns true if field scan_bytes_from_local_storage is set (has been assigned a value) and false otherwise */
  public boolean isSetScanBytesFromLocalStorage() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCAN_BYTES_FROM_LOCAL_STORAGE_ISSET_ID);
  }

  public void setScanBytesFromLocalStorageIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCAN_BYTES_FROM_LOCAL_STORAGE_ISSET_ID, value);
  }

  public long getScanBytesFromRemoteStorage() {
    return this.scan_bytes_from_remote_storage;
  }

  public TQueryStatistics setScanBytesFromRemoteStorage(long scan_bytes_from_remote_storage) {
    this.scan_bytes_from_remote_storage = scan_bytes_from_remote_storage;
    setScanBytesFromRemoteStorageIsSet(true);
    return this;
  }

  public void unsetScanBytesFromRemoteStorage() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCAN_BYTES_FROM_REMOTE_STORAGE_ISSET_ID);
  }

  /** Returns true if field scan_bytes_from_remote_storage is set (has been assigned a value) and false otherwise */
  public boolean isSetScanBytesFromRemoteStorage() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCAN_BYTES_FROM_REMOTE_STORAGE_ISSET_ID);
  }

  public void setScanBytesFromRemoteStorageIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCAN_BYTES_FROM_REMOTE_STORAGE_ISSET_ID, value);
  }

  public long getSpillWriteBytesToLocalStorage() {
    return this.spill_write_bytes_to_local_storage;
  }

  public TQueryStatistics setSpillWriteBytesToLocalStorage(long spill_write_bytes_to_local_storage) {
    this.spill_write_bytes_to_local_storage = spill_write_bytes_to_local_storage;
    setSpillWriteBytesToLocalStorageIsSet(true);
    return this;
  }

  public void unsetSpillWriteBytesToLocalStorage() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_ISSET_ID);
  }

  /** Returns true if field spill_write_bytes_to_local_storage is set (has been assigned a value) and false otherwise */
  public boolean isSetSpillWriteBytesToLocalStorage() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_ISSET_ID);
  }

  public void setSpillWriteBytesToLocalStorageIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_ISSET_ID, value);
  }

  public long getSpillReadBytesFromLocalStorage() {
    return this.spill_read_bytes_from_local_storage;
  }

  public TQueryStatistics setSpillReadBytesFromLocalStorage(long spill_read_bytes_from_local_storage) {
    this.spill_read_bytes_from_local_storage = spill_read_bytes_from_local_storage;
    setSpillReadBytesFromLocalStorageIsSet(true);
    return this;
  }

  public void unsetSpillReadBytesFromLocalStorage() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SPILL_READ_BYTES_FROM_LOCAL_STORAGE_ISSET_ID);
  }

  /** Returns true if field spill_read_bytes_from_local_storage is set (has been assigned a value) and false otherwise */
  public boolean isSetSpillReadBytesFromLocalStorage() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SPILL_READ_BYTES_FROM_LOCAL_STORAGE_ISSET_ID);
  }

  public void setSpillReadBytesFromLocalStorageIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SPILL_READ_BYTES_FROM_LOCAL_STORAGE_ISSET_ID, value);
  }

  public long getBytesWriteIntoCache() {
    return this.bytes_write_into_cache;
  }

  public TQueryStatistics setBytesWriteIntoCache(long bytes_write_into_cache) {
    this.bytes_write_into_cache = bytes_write_into_cache;
    setBytesWriteIntoCacheIsSet(true);
    return this;
  }

  public void unsetBytesWriteIntoCache() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BYTES_WRITE_INTO_CACHE_ISSET_ID);
  }

  /** Returns true if field bytes_write_into_cache is set (has been assigned a value) and false otherwise */
  public boolean isSetBytesWriteIntoCache() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BYTES_WRITE_INTO_CACHE_ISSET_ID);
  }

  public void setBytesWriteIntoCacheIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BYTES_WRITE_INTO_CACHE_ISSET_ID, value);
  }

  public long getProcessRows() {
    return this.process_rows;
  }

  public TQueryStatistics setProcessRows(long process_rows) {
    this.process_rows = process_rows;
    setProcessRowsIsSet(true);
    return this;
  }

  public void unsetProcessRows() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PROCESS_ROWS_ISSET_ID);
  }

  /** Returns true if field process_rows is set (has been assigned a value) and false otherwise */
  public boolean isSetProcessRows() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PROCESS_ROWS_ISSET_ID);
  }

  public void setProcessRowsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PROCESS_ROWS_ISSET_ID, value);
  }

  public int getFinishedTasksNum() {
    return this.finished_tasks_num;
  }

  public TQueryStatistics setFinishedTasksNum(int finished_tasks_num) {
    this.finished_tasks_num = finished_tasks_num;
    setFinishedTasksNumIsSet(true);
    return this;
  }

  public void unsetFinishedTasksNum() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FINISHED_TASKS_NUM_ISSET_ID);
  }

  /** Returns true if field finished_tasks_num is set (has been assigned a value) and false otherwise */
  public boolean isSetFinishedTasksNum() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FINISHED_TASKS_NUM_ISSET_ID);
  }

  public void setFinishedTasksNumIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FINISHED_TASKS_NUM_ISSET_ID, value);
  }

  public int getTotalTasksNum() {
    return this.total_tasks_num;
  }

  public TQueryStatistics setTotalTasksNum(int total_tasks_num) {
    this.total_tasks_num = total_tasks_num;
    setTotalTasksNumIsSet(true);
    return this;
  }

  public void unsetTotalTasksNum() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TOTAL_TASKS_NUM_ISSET_ID);
  }

  /** Returns true if field total_tasks_num is set (has been assigned a value) and false otherwise */
  public boolean isSetTotalTasksNum() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TOTAL_TASKS_NUM_ISSET_ID);
  }

  public void setTotalTasksNumIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TOTAL_TASKS_NUM_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SCAN_ROWS:
      if (value == null) {
        unsetScanRows();
      } else {
        setScanRows((java.lang.Long)value);
      }
      break;

    case SCAN_BYTES:
      if (value == null) {
        unsetScanBytes();
      } else {
        setScanBytes((java.lang.Long)value);
      }
      break;

    case RETURNED_ROWS:
      if (value == null) {
        unsetReturnedRows();
      } else {
        setReturnedRows((java.lang.Long)value);
      }
      break;

    case CPU_MS:
      if (value == null) {
        unsetCpuMs();
      } else {
        setCpuMs((java.lang.Long)value);
      }
      break;

    case MAX_PEAK_MEMORY_BYTES:
      if (value == null) {
        unsetMaxPeakMemoryBytes();
      } else {
        setMaxPeakMemoryBytes((java.lang.Long)value);
      }
      break;

    case CURRENT_USED_MEMORY_BYTES:
      if (value == null) {
        unsetCurrentUsedMemoryBytes();
      } else {
        setCurrentUsedMemoryBytes((java.lang.Long)value);
      }
      break;

    case WORKLOAD_GROUP_ID:
      if (value == null) {
        unsetWorkloadGroupId();
      } else {
        setWorkloadGroupId((java.lang.Long)value);
      }
      break;

    case SHUFFLE_SEND_BYTES:
      if (value == null) {
        unsetShuffleSendBytes();
      } else {
        setShuffleSendBytes((java.lang.Long)value);
      }
      break;

    case SHUFFLE_SEND_ROWS:
      if (value == null) {
        unsetShuffleSendRows();
      } else {
        setShuffleSendRows((java.lang.Long)value);
      }
      break;

    case SCAN_BYTES_FROM_LOCAL_STORAGE:
      if (value == null) {
        unsetScanBytesFromLocalStorage();
      } else {
        setScanBytesFromLocalStorage((java.lang.Long)value);
      }
      break;

    case SCAN_BYTES_FROM_REMOTE_STORAGE:
      if (value == null) {
        unsetScanBytesFromRemoteStorage();
      } else {
        setScanBytesFromRemoteStorage((java.lang.Long)value);
      }
      break;

    case SPILL_WRITE_BYTES_TO_LOCAL_STORAGE:
      if (value == null) {
        unsetSpillWriteBytesToLocalStorage();
      } else {
        setSpillWriteBytesToLocalStorage((java.lang.Long)value);
      }
      break;

    case SPILL_READ_BYTES_FROM_LOCAL_STORAGE:
      if (value == null) {
        unsetSpillReadBytesFromLocalStorage();
      } else {
        setSpillReadBytesFromLocalStorage((java.lang.Long)value);
      }
      break;

    case BYTES_WRITE_INTO_CACHE:
      if (value == null) {
        unsetBytesWriteIntoCache();
      } else {
        setBytesWriteIntoCache((java.lang.Long)value);
      }
      break;

    case PROCESS_ROWS:
      if (value == null) {
        unsetProcessRows();
      } else {
        setProcessRows((java.lang.Long)value);
      }
      break;

    case FINISHED_TASKS_NUM:
      if (value == null) {
        unsetFinishedTasksNum();
      } else {
        setFinishedTasksNum((java.lang.Integer)value);
      }
      break;

    case TOTAL_TASKS_NUM:
      if (value == null) {
        unsetTotalTasksNum();
      } else {
        setTotalTasksNum((java.lang.Integer)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case SCAN_ROWS:
      return getScanRows();

    case SCAN_BYTES:
      return getScanBytes();

    case RETURNED_ROWS:
      return getReturnedRows();

    case CPU_MS:
      return getCpuMs();

    case MAX_PEAK_MEMORY_BYTES:
      return getMaxPeakMemoryBytes();

    case CURRENT_USED_MEMORY_BYTES:
      return getCurrentUsedMemoryBytes();

    case WORKLOAD_GROUP_ID:
      return getWorkloadGroupId();

    case SHUFFLE_SEND_BYTES:
      return getShuffleSendBytes();

    case SHUFFLE_SEND_ROWS:
      return getShuffleSendRows();

    case SCAN_BYTES_FROM_LOCAL_STORAGE:
      return getScanBytesFromLocalStorage();

    case SCAN_BYTES_FROM_REMOTE_STORAGE:
      return getScanBytesFromRemoteStorage();

    case SPILL_WRITE_BYTES_TO_LOCAL_STORAGE:
      return getSpillWriteBytesToLocalStorage();

    case SPILL_READ_BYTES_FROM_LOCAL_STORAGE:
      return getSpillReadBytesFromLocalStorage();

    case BYTES_WRITE_INTO_CACHE:
      return getBytesWriteIntoCache();

    case PROCESS_ROWS:
      return getProcessRows();

    case FINISHED_TASKS_NUM:
      return getFinishedTasksNum();

    case TOTAL_TASKS_NUM:
      return getTotalTasksNum();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case SCAN_ROWS:
      return isSetScanRows();
    case SCAN_BYTES:
      return isSetScanBytes();
    case RETURNED_ROWS:
      return isSetReturnedRows();
    case CPU_MS:
      return isSetCpuMs();
    case MAX_PEAK_MEMORY_BYTES:
      return isSetMaxPeakMemoryBytes();
    case CURRENT_USED_MEMORY_BYTES:
      return isSetCurrentUsedMemoryBytes();
    case WORKLOAD_GROUP_ID:
      return isSetWorkloadGroupId();
    case SHUFFLE_SEND_BYTES:
      return isSetShuffleSendBytes();
    case SHUFFLE_SEND_ROWS:
      return isSetShuffleSendRows();
    case SCAN_BYTES_FROM_LOCAL_STORAGE:
      return isSetScanBytesFromLocalStorage();
    case SCAN_BYTES_FROM_REMOTE_STORAGE:
      return isSetScanBytesFromRemoteStorage();
    case SPILL_WRITE_BYTES_TO_LOCAL_STORAGE:
      return isSetSpillWriteBytesToLocalStorage();
    case SPILL_READ_BYTES_FROM_LOCAL_STORAGE:
      return isSetSpillReadBytesFromLocalStorage();
    case BYTES_WRITE_INTO_CACHE:
      return isSetBytesWriteIntoCache();
    case PROCESS_ROWS:
      return isSetProcessRows();
    case FINISHED_TASKS_NUM:
      return isSetFinishedTasksNum();
    case TOTAL_TASKS_NUM:
      return isSetTotalTasksNum();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TQueryStatistics)
      return this.equals((TQueryStatistics)that);
    return false;
  }

  public boolean equals(TQueryStatistics that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_scan_rows = true && this.isSetScanRows();
    boolean that_present_scan_rows = true && that.isSetScanRows();
    if (this_present_scan_rows || that_present_scan_rows) {
      if (!(this_present_scan_rows && that_present_scan_rows))
        return false;
      if (this.scan_rows != that.scan_rows)
        return false;
    }

    boolean this_present_scan_bytes = true && this.isSetScanBytes();
    boolean that_present_scan_bytes = true && that.isSetScanBytes();
    if (this_present_scan_bytes || that_present_scan_bytes) {
      if (!(this_present_scan_bytes && that_present_scan_bytes))
        return false;
      if (this.scan_bytes != that.scan_bytes)
        return false;
    }

    boolean this_present_returned_rows = true && this.isSetReturnedRows();
    boolean that_present_returned_rows = true && that.isSetReturnedRows();
    if (this_present_returned_rows || that_present_returned_rows) {
      if (!(this_present_returned_rows && that_present_returned_rows))
        return false;
      if (this.returned_rows != that.returned_rows)
        return false;
    }

    boolean this_present_cpu_ms = true && this.isSetCpuMs();
    boolean that_present_cpu_ms = true && that.isSetCpuMs();
    if (this_present_cpu_ms || that_present_cpu_ms) {
      if (!(this_present_cpu_ms && that_present_cpu_ms))
        return false;
      if (this.cpu_ms != that.cpu_ms)
        return false;
    }

    boolean this_present_max_peak_memory_bytes = true && this.isSetMaxPeakMemoryBytes();
    boolean that_present_max_peak_memory_bytes = true && that.isSetMaxPeakMemoryBytes();
    if (this_present_max_peak_memory_bytes || that_present_max_peak_memory_bytes) {
      if (!(this_present_max_peak_memory_bytes && that_present_max_peak_memory_bytes))
        return false;
      if (this.max_peak_memory_bytes != that.max_peak_memory_bytes)
        return false;
    }

    boolean this_present_current_used_memory_bytes = true && this.isSetCurrentUsedMemoryBytes();
    boolean that_present_current_used_memory_bytes = true && that.isSetCurrentUsedMemoryBytes();
    if (this_present_current_used_memory_bytes || that_present_current_used_memory_bytes) {
      if (!(this_present_current_used_memory_bytes && that_present_current_used_memory_bytes))
        return false;
      if (this.current_used_memory_bytes != that.current_used_memory_bytes)
        return false;
    }

    boolean this_present_workload_group_id = true && this.isSetWorkloadGroupId();
    boolean that_present_workload_group_id = true && that.isSetWorkloadGroupId();
    if (this_present_workload_group_id || that_present_workload_group_id) {
      if (!(this_present_workload_group_id && that_present_workload_group_id))
        return false;
      if (this.workload_group_id != that.workload_group_id)
        return false;
    }

    boolean this_present_shuffle_send_bytes = true && this.isSetShuffleSendBytes();
    boolean that_present_shuffle_send_bytes = true && that.isSetShuffleSendBytes();
    if (this_present_shuffle_send_bytes || that_present_shuffle_send_bytes) {
      if (!(this_present_shuffle_send_bytes && that_present_shuffle_send_bytes))
        return false;
      if (this.shuffle_send_bytes != that.shuffle_send_bytes)
        return false;
    }

    boolean this_present_shuffle_send_rows = true && this.isSetShuffleSendRows();
    boolean that_present_shuffle_send_rows = true && that.isSetShuffleSendRows();
    if (this_present_shuffle_send_rows || that_present_shuffle_send_rows) {
      if (!(this_present_shuffle_send_rows && that_present_shuffle_send_rows))
        return false;
      if (this.shuffle_send_rows != that.shuffle_send_rows)
        return false;
    }

    boolean this_present_scan_bytes_from_local_storage = true && this.isSetScanBytesFromLocalStorage();
    boolean that_present_scan_bytes_from_local_storage = true && that.isSetScanBytesFromLocalStorage();
    if (this_present_scan_bytes_from_local_storage || that_present_scan_bytes_from_local_storage) {
      if (!(this_present_scan_bytes_from_local_storage && that_present_scan_bytes_from_local_storage))
        return false;
      if (this.scan_bytes_from_local_storage != that.scan_bytes_from_local_storage)
        return false;
    }

    boolean this_present_scan_bytes_from_remote_storage = true && this.isSetScanBytesFromRemoteStorage();
    boolean that_present_scan_bytes_from_remote_storage = true && that.isSetScanBytesFromRemoteStorage();
    if (this_present_scan_bytes_from_remote_storage || that_present_scan_bytes_from_remote_storage) {
      if (!(this_present_scan_bytes_from_remote_storage && that_present_scan_bytes_from_remote_storage))
        return false;
      if (this.scan_bytes_from_remote_storage != that.scan_bytes_from_remote_storage)
        return false;
    }

    boolean this_present_spill_write_bytes_to_local_storage = true && this.isSetSpillWriteBytesToLocalStorage();
    boolean that_present_spill_write_bytes_to_local_storage = true && that.isSetSpillWriteBytesToLocalStorage();
    if (this_present_spill_write_bytes_to_local_storage || that_present_spill_write_bytes_to_local_storage) {
      if (!(this_present_spill_write_bytes_to_local_storage && that_present_spill_write_bytes_to_local_storage))
        return false;
      if (this.spill_write_bytes_to_local_storage != that.spill_write_bytes_to_local_storage)
        return false;
    }

    boolean this_present_spill_read_bytes_from_local_storage = true && this.isSetSpillReadBytesFromLocalStorage();
    boolean that_present_spill_read_bytes_from_local_storage = true && that.isSetSpillReadBytesFromLocalStorage();
    if (this_present_spill_read_bytes_from_local_storage || that_present_spill_read_bytes_from_local_storage) {
      if (!(this_present_spill_read_bytes_from_local_storage && that_present_spill_read_bytes_from_local_storage))
        return false;
      if (this.spill_read_bytes_from_local_storage != that.spill_read_bytes_from_local_storage)
        return false;
    }

    boolean this_present_bytes_write_into_cache = true && this.isSetBytesWriteIntoCache();
    boolean that_present_bytes_write_into_cache = true && that.isSetBytesWriteIntoCache();
    if (this_present_bytes_write_into_cache || that_present_bytes_write_into_cache) {
      if (!(this_present_bytes_write_into_cache && that_present_bytes_write_into_cache))
        return false;
      if (this.bytes_write_into_cache != that.bytes_write_into_cache)
        return false;
    }

    boolean this_present_process_rows = true && this.isSetProcessRows();
    boolean that_present_process_rows = true && that.isSetProcessRows();
    if (this_present_process_rows || that_present_process_rows) {
      if (!(this_present_process_rows && that_present_process_rows))
        return false;
      if (this.process_rows != that.process_rows)
        return false;
    }

    boolean this_present_finished_tasks_num = true && this.isSetFinishedTasksNum();
    boolean that_present_finished_tasks_num = true && that.isSetFinishedTasksNum();
    if (this_present_finished_tasks_num || that_present_finished_tasks_num) {
      if (!(this_present_finished_tasks_num && that_present_finished_tasks_num))
        return false;
      if (this.finished_tasks_num != that.finished_tasks_num)
        return false;
    }

    boolean this_present_total_tasks_num = true && this.isSetTotalTasksNum();
    boolean that_present_total_tasks_num = true && that.isSetTotalTasksNum();
    if (this_present_total_tasks_num || that_present_total_tasks_num) {
      if (!(this_present_total_tasks_num && that_present_total_tasks_num))
        return false;
      if (this.total_tasks_num != that.total_tasks_num)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetScanRows()) ? 131071 : 524287);
    if (isSetScanRows())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(scan_rows);

    hashCode = hashCode * 8191 + ((isSetScanBytes()) ? 131071 : 524287);
    if (isSetScanBytes())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(scan_bytes);

    hashCode = hashCode * 8191 + ((isSetReturnedRows()) ? 131071 : 524287);
    if (isSetReturnedRows())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(returned_rows);

    hashCode = hashCode * 8191 + ((isSetCpuMs()) ? 131071 : 524287);
    if (isSetCpuMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(cpu_ms);

    hashCode = hashCode * 8191 + ((isSetMaxPeakMemoryBytes()) ? 131071 : 524287);
    if (isSetMaxPeakMemoryBytes())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(max_peak_memory_bytes);

    hashCode = hashCode * 8191 + ((isSetCurrentUsedMemoryBytes()) ? 131071 : 524287);
    if (isSetCurrentUsedMemoryBytes())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(current_used_memory_bytes);

    hashCode = hashCode * 8191 + ((isSetWorkloadGroupId()) ? 131071 : 524287);
    if (isSetWorkloadGroupId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(workload_group_id);

    hashCode = hashCode * 8191 + ((isSetShuffleSendBytes()) ? 131071 : 524287);
    if (isSetShuffleSendBytes())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(shuffle_send_bytes);

    hashCode = hashCode * 8191 + ((isSetShuffleSendRows()) ? 131071 : 524287);
    if (isSetShuffleSendRows())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(shuffle_send_rows);

    hashCode = hashCode * 8191 + ((isSetScanBytesFromLocalStorage()) ? 131071 : 524287);
    if (isSetScanBytesFromLocalStorage())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(scan_bytes_from_local_storage);

    hashCode = hashCode * 8191 + ((isSetScanBytesFromRemoteStorage()) ? 131071 : 524287);
    if (isSetScanBytesFromRemoteStorage())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(scan_bytes_from_remote_storage);

    hashCode = hashCode * 8191 + ((isSetSpillWriteBytesToLocalStorage()) ? 131071 : 524287);
    if (isSetSpillWriteBytesToLocalStorage())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(spill_write_bytes_to_local_storage);

    hashCode = hashCode * 8191 + ((isSetSpillReadBytesFromLocalStorage()) ? 131071 : 524287);
    if (isSetSpillReadBytesFromLocalStorage())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(spill_read_bytes_from_local_storage);

    hashCode = hashCode * 8191 + ((isSetBytesWriteIntoCache()) ? 131071 : 524287);
    if (isSetBytesWriteIntoCache())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(bytes_write_into_cache);

    hashCode = hashCode * 8191 + ((isSetProcessRows()) ? 131071 : 524287);
    if (isSetProcessRows())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(process_rows);

    hashCode = hashCode * 8191 + ((isSetFinishedTasksNum()) ? 131071 : 524287);
    if (isSetFinishedTasksNum())
      hashCode = hashCode * 8191 + finished_tasks_num;

    hashCode = hashCode * 8191 + ((isSetTotalTasksNum()) ? 131071 : 524287);
    if (isSetTotalTasksNum())
      hashCode = hashCode * 8191 + total_tasks_num;

    return hashCode;
  }

  @Override
  public int compareTo(TQueryStatistics other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetScanRows(), other.isSetScanRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScanRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan_rows, other.scan_rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetScanBytes(), other.isSetScanBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScanBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan_bytes, other.scan_bytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetReturnedRows(), other.isSetReturnedRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReturnedRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returned_rows, other.returned_rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCpuMs(), other.isSetCpuMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCpuMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu_ms, other.cpu_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMaxPeakMemoryBytes(), other.isSetMaxPeakMemoryBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxPeakMemoryBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_peak_memory_bytes, other.max_peak_memory_bytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCurrentUsedMemoryBytes(), other.isSetCurrentUsedMemoryBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCurrentUsedMemoryBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.current_used_memory_bytes, other.current_used_memory_bytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetWorkloadGroupId(), other.isSetWorkloadGroupId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkloadGroupId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workload_group_id, other.workload_group_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetShuffleSendBytes(), other.isSetShuffleSendBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShuffleSendBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shuffle_send_bytes, other.shuffle_send_bytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetShuffleSendRows(), other.isSetShuffleSendRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShuffleSendRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shuffle_send_rows, other.shuffle_send_rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetScanBytesFromLocalStorage(), other.isSetScanBytesFromLocalStorage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScanBytesFromLocalStorage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan_bytes_from_local_storage, other.scan_bytes_from_local_storage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetScanBytesFromRemoteStorage(), other.isSetScanBytesFromRemoteStorage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScanBytesFromRemoteStorage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scan_bytes_from_remote_storage, other.scan_bytes_from_remote_storage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSpillWriteBytesToLocalStorage(), other.isSetSpillWriteBytesToLocalStorage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSpillWriteBytesToLocalStorage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spill_write_bytes_to_local_storage, other.spill_write_bytes_to_local_storage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSpillReadBytesFromLocalStorage(), other.isSetSpillReadBytesFromLocalStorage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSpillReadBytesFromLocalStorage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spill_read_bytes_from_local_storage, other.spill_read_bytes_from_local_storage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBytesWriteIntoCache(), other.isSetBytesWriteIntoCache());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBytesWriteIntoCache()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bytes_write_into_cache, other.bytes_write_into_cache);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetProcessRows(), other.isSetProcessRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProcessRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_rows, other.process_rows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFinishedTasksNum(), other.isSetFinishedTasksNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFinishedTasksNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.finished_tasks_num, other.finished_tasks_num);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTotalTasksNum(), other.isSetTotalTasksNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalTasksNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_tasks_num, other.total_tasks_num);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TQueryStatistics(");
    boolean first = true;

    if (isSetScanRows()) {
      sb.append("scan_rows:");
      sb.append(this.scan_rows);
      first = false;
    }
    if (isSetScanBytes()) {
      if (!first) sb.append(", ");
      sb.append("scan_bytes:");
      sb.append(this.scan_bytes);
      first = false;
    }
    if (isSetReturnedRows()) {
      if (!first) sb.append(", ");
      sb.append("returned_rows:");
      sb.append(this.returned_rows);
      first = false;
    }
    if (isSetCpuMs()) {
      if (!first) sb.append(", ");
      sb.append("cpu_ms:");
      sb.append(this.cpu_ms);
      first = false;
    }
    if (isSetMaxPeakMemoryBytes()) {
      if (!first) sb.append(", ");
      sb.append("max_peak_memory_bytes:");
      sb.append(this.max_peak_memory_bytes);
      first = false;
    }
    if (isSetCurrentUsedMemoryBytes()) {
      if (!first) sb.append(", ");
      sb.append("current_used_memory_bytes:");
      sb.append(this.current_used_memory_bytes);
      first = false;
    }
    if (isSetWorkloadGroupId()) {
      if (!first) sb.append(", ");
      sb.append("workload_group_id:");
      sb.append(this.workload_group_id);
      first = false;
    }
    if (isSetShuffleSendBytes()) {
      if (!first) sb.append(", ");
      sb.append("shuffle_send_bytes:");
      sb.append(this.shuffle_send_bytes);
      first = false;
    }
    if (isSetShuffleSendRows()) {
      if (!first) sb.append(", ");
      sb.append("shuffle_send_rows:");
      sb.append(this.shuffle_send_rows);
      first = false;
    }
    if (isSetScanBytesFromLocalStorage()) {
      if (!first) sb.append(", ");
      sb.append("scan_bytes_from_local_storage:");
      sb.append(this.scan_bytes_from_local_storage);
      first = false;
    }
    if (isSetScanBytesFromRemoteStorage()) {
      if (!first) sb.append(", ");
      sb.append("scan_bytes_from_remote_storage:");
      sb.append(this.scan_bytes_from_remote_storage);
      first = false;
    }
    if (isSetSpillWriteBytesToLocalStorage()) {
      if (!first) sb.append(", ");
      sb.append("spill_write_bytes_to_local_storage:");
      sb.append(this.spill_write_bytes_to_local_storage);
      first = false;
    }
    if (isSetSpillReadBytesFromLocalStorage()) {
      if (!first) sb.append(", ");
      sb.append("spill_read_bytes_from_local_storage:");
      sb.append(this.spill_read_bytes_from_local_storage);
      first = false;
    }
    if (isSetBytesWriteIntoCache()) {
      if (!first) sb.append(", ");
      sb.append("bytes_write_into_cache:");
      sb.append(this.bytes_write_into_cache);
      first = false;
    }
    if (isSetProcessRows()) {
      if (!first) sb.append(", ");
      sb.append("process_rows:");
      sb.append(this.process_rows);
      first = false;
    }
    if (isSetFinishedTasksNum()) {
      if (!first) sb.append(", ");
      sb.append("finished_tasks_num:");
      sb.append(this.finished_tasks_num);
      first = false;
    }
    if (isSetTotalTasksNum()) {
      if (!first) sb.append(", ");
      sb.append("total_tasks_num:");
      sb.append(this.total_tasks_num);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TQueryStatisticsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TQueryStatisticsStandardScheme getScheme() {
      return new TQueryStatisticsStandardScheme();
    }
  }

  private static class TQueryStatisticsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TQueryStatistics> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryStatistics struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // SCAN_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scan_rows = iprot.readI64();
              struct.setScanRowsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SCAN_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scan_bytes = iprot.readI64();
              struct.setScanBytesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // RETURNED_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.returned_rows = iprot.readI64();
              struct.setReturnedRowsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CPU_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.cpu_ms = iprot.readI64();
              struct.setCpuMsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MAX_PEAK_MEMORY_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.max_peak_memory_bytes = iprot.readI64();
              struct.setMaxPeakMemoryBytesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CURRENT_USED_MEMORY_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.current_used_memory_bytes = iprot.readI64();
              struct.setCurrentUsedMemoryBytesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // WORKLOAD_GROUP_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.workload_group_id = iprot.readI64();
              struct.setWorkloadGroupIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // SHUFFLE_SEND_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.shuffle_send_bytes = iprot.readI64();
              struct.setShuffleSendBytesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // SHUFFLE_SEND_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.shuffle_send_rows = iprot.readI64();
              struct.setShuffleSendRowsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // SCAN_BYTES_FROM_LOCAL_STORAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scan_bytes_from_local_storage = iprot.readI64();
              struct.setScanBytesFromLocalStorageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // SCAN_BYTES_FROM_REMOTE_STORAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scan_bytes_from_remote_storage = iprot.readI64();
              struct.setScanBytesFromRemoteStorageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // SPILL_WRITE_BYTES_TO_LOCAL_STORAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.spill_write_bytes_to_local_storage = iprot.readI64();
              struct.setSpillWriteBytesToLocalStorageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // SPILL_READ_BYTES_FROM_LOCAL_STORAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.spill_read_bytes_from_local_storage = iprot.readI64();
              struct.setSpillReadBytesFromLocalStorageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // BYTES_WRITE_INTO_CACHE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.bytes_write_into_cache = iprot.readI64();
              struct.setBytesWriteIntoCacheIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 15: // PROCESS_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.process_rows = iprot.readI64();
              struct.setProcessRowsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 16: // FINISHED_TASKS_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.finished_tasks_num = iprot.readI32();
              struct.setFinishedTasksNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 17: // TOTAL_TASKS_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.total_tasks_num = iprot.readI32();
              struct.setTotalTasksNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TQueryStatistics struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetScanRows()) {
        oprot.writeFieldBegin(SCAN_ROWS_FIELD_DESC);
        oprot.writeI64(struct.scan_rows);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScanBytes()) {
        oprot.writeFieldBegin(SCAN_BYTES_FIELD_DESC);
        oprot.writeI64(struct.scan_bytes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetReturnedRows()) {
        oprot.writeFieldBegin(RETURNED_ROWS_FIELD_DESC);
        oprot.writeI64(struct.returned_rows);
        oprot.writeFieldEnd();
      }
      if (struct.isSetCpuMs()) {
        oprot.writeFieldBegin(CPU_MS_FIELD_DESC);
        oprot.writeI64(struct.cpu_ms);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxPeakMemoryBytes()) {
        oprot.writeFieldBegin(MAX_PEAK_MEMORY_BYTES_FIELD_DESC);
        oprot.writeI64(struct.max_peak_memory_bytes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetCurrentUsedMemoryBytes()) {
        oprot.writeFieldBegin(CURRENT_USED_MEMORY_BYTES_FIELD_DESC);
        oprot.writeI64(struct.current_used_memory_bytes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetWorkloadGroupId()) {
        oprot.writeFieldBegin(WORKLOAD_GROUP_ID_FIELD_DESC);
        oprot.writeI64(struct.workload_group_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetShuffleSendBytes()) {
        oprot.writeFieldBegin(SHUFFLE_SEND_BYTES_FIELD_DESC);
        oprot.writeI64(struct.shuffle_send_bytes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetShuffleSendRows()) {
        oprot.writeFieldBegin(SHUFFLE_SEND_ROWS_FIELD_DESC);
        oprot.writeI64(struct.shuffle_send_rows);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScanBytesFromLocalStorage()) {
        oprot.writeFieldBegin(SCAN_BYTES_FROM_LOCAL_STORAGE_FIELD_DESC);
        oprot.writeI64(struct.scan_bytes_from_local_storage);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScanBytesFromRemoteStorage()) {
        oprot.writeFieldBegin(SCAN_BYTES_FROM_REMOTE_STORAGE_FIELD_DESC);
        oprot.writeI64(struct.scan_bytes_from_remote_storage);
        oprot.writeFieldEnd();
      }
      if (struct.isSetSpillWriteBytesToLocalStorage()) {
        oprot.writeFieldBegin(SPILL_WRITE_BYTES_TO_LOCAL_STORAGE_FIELD_DESC);
        oprot.writeI64(struct.spill_write_bytes_to_local_storage);
        oprot.writeFieldEnd();
      }
      if (struct.isSetSpillReadBytesFromLocalStorage()) {
        oprot.writeFieldBegin(SPILL_READ_BYTES_FROM_LOCAL_STORAGE_FIELD_DESC);
        oprot.writeI64(struct.spill_read_bytes_from_local_storage);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBytesWriteIntoCache()) {
        oprot.writeFieldBegin(BYTES_WRITE_INTO_CACHE_FIELD_DESC);
        oprot.writeI64(struct.bytes_write_into_cache);
        oprot.writeFieldEnd();
      }
      if (struct.isSetProcessRows()) {
        oprot.writeFieldBegin(PROCESS_ROWS_FIELD_DESC);
        oprot.writeI64(struct.process_rows);
        oprot.writeFieldEnd();
      }
      if (struct.isSetFinishedTasksNum()) {
        oprot.writeFieldBegin(FINISHED_TASKS_NUM_FIELD_DESC);
        oprot.writeI32(struct.finished_tasks_num);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTotalTasksNum()) {
        oprot.writeFieldBegin(TOTAL_TASKS_NUM_FIELD_DESC);
        oprot.writeI32(struct.total_tasks_num);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TQueryStatisticsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TQueryStatisticsTupleScheme getScheme() {
      return new TQueryStatisticsTupleScheme();
    }
  }

  private static class TQueryStatisticsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TQueryStatistics> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TQueryStatistics struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetScanRows()) {
        optionals.set(0);
      }
      if (struct.isSetScanBytes()) {
        optionals.set(1);
      }
      if (struct.isSetReturnedRows()) {
        optionals.set(2);
      }
      if (struct.isSetCpuMs()) {
        optionals.set(3);
      }
      if (struct.isSetMaxPeakMemoryBytes()) {
        optionals.set(4);
      }
      if (struct.isSetCurrentUsedMemoryBytes()) {
        optionals.set(5);
      }
      if (struct.isSetWorkloadGroupId()) {
        optionals.set(6);
      }
      if (struct.isSetShuffleSendBytes()) {
        optionals.set(7);
      }
      if (struct.isSetShuffleSendRows()) {
        optionals.set(8);
      }
      if (struct.isSetScanBytesFromLocalStorage()) {
        optionals.set(9);
      }
      if (struct.isSetScanBytesFromRemoteStorage()) {
        optionals.set(10);
      }
      if (struct.isSetSpillWriteBytesToLocalStorage()) {
        optionals.set(11);
      }
      if (struct.isSetSpillReadBytesFromLocalStorage()) {
        optionals.set(12);
      }
      if (struct.isSetBytesWriteIntoCache()) {
        optionals.set(13);
      }
      if (struct.isSetProcessRows()) {
        optionals.set(14);
      }
      if (struct.isSetFinishedTasksNum()) {
        optionals.set(15);
      }
      if (struct.isSetTotalTasksNum()) {
        optionals.set(16);
      }
      oprot.writeBitSet(optionals, 17);
      if (struct.isSetScanRows()) {
        oprot.writeI64(struct.scan_rows);
      }
      if (struct.isSetScanBytes()) {
        oprot.writeI64(struct.scan_bytes);
      }
      if (struct.isSetReturnedRows()) {
        oprot.writeI64(struct.returned_rows);
      }
      if (struct.isSetCpuMs()) {
        oprot.writeI64(struct.cpu_ms);
      }
      if (struct.isSetMaxPeakMemoryBytes()) {
        oprot.writeI64(struct.max_peak_memory_bytes);
      }
      if (struct.isSetCurrentUsedMemoryBytes()) {
        oprot.writeI64(struct.current_used_memory_bytes);
      }
      if (struct.isSetWorkloadGroupId()) {
        oprot.writeI64(struct.workload_group_id);
      }
      if (struct.isSetShuffleSendBytes()) {
        oprot.writeI64(struct.shuffle_send_bytes);
      }
      if (struct.isSetShuffleSendRows()) {
        oprot.writeI64(struct.shuffle_send_rows);
      }
      if (struct.isSetScanBytesFromLocalStorage()) {
        oprot.writeI64(struct.scan_bytes_from_local_storage);
      }
      if (struct.isSetScanBytesFromRemoteStorage()) {
        oprot.writeI64(struct.scan_bytes_from_remote_storage);
      }
      if (struct.isSetSpillWriteBytesToLocalStorage()) {
        oprot.writeI64(struct.spill_write_bytes_to_local_storage);
      }
      if (struct.isSetSpillReadBytesFromLocalStorage()) {
        oprot.writeI64(struct.spill_read_bytes_from_local_storage);
      }
      if (struct.isSetBytesWriteIntoCache()) {
        oprot.writeI64(struct.bytes_write_into_cache);
      }
      if (struct.isSetProcessRows()) {
        oprot.writeI64(struct.process_rows);
      }
      if (struct.isSetFinishedTasksNum()) {
        oprot.writeI32(struct.finished_tasks_num);
      }
      if (struct.isSetTotalTasksNum()) {
        oprot.writeI32(struct.total_tasks_num);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TQueryStatistics struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(17);
      if (incoming.get(0)) {
        struct.scan_rows = iprot.readI64();
        struct.setScanRowsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.scan_bytes = iprot.readI64();
        struct.setScanBytesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.returned_rows = iprot.readI64();
        struct.setReturnedRowsIsSet(true);
      }
      if (incoming.get(3)) {
        struct.cpu_ms = iprot.readI64();
        struct.setCpuMsIsSet(true);
      }
      if (incoming.get(4)) {
        struct.max_peak_memory_bytes = iprot.readI64();
        struct.setMaxPeakMemoryBytesIsSet(true);
      }
      if (incoming.get(5)) {
        struct.current_used_memory_bytes = iprot.readI64();
        struct.setCurrentUsedMemoryBytesIsSet(true);
      }
      if (incoming.get(6)) {
        struct.workload_group_id = iprot.readI64();
        struct.setWorkloadGroupIdIsSet(true);
      }
      if (incoming.get(7)) {
        struct.shuffle_send_bytes = iprot.readI64();
        struct.setShuffleSendBytesIsSet(true);
      }
      if (incoming.get(8)) {
        struct.shuffle_send_rows = iprot.readI64();
        struct.setShuffleSendRowsIsSet(true);
      }
      if (incoming.get(9)) {
        struct.scan_bytes_from_local_storage = iprot.readI64();
        struct.setScanBytesFromLocalStorageIsSet(true);
      }
      if (incoming.get(10)) {
        struct.scan_bytes_from_remote_storage = iprot.readI64();
        struct.setScanBytesFromRemoteStorageIsSet(true);
      }
      if (incoming.get(11)) {
        struct.spill_write_bytes_to_local_storage = iprot.readI64();
        struct.setSpillWriteBytesToLocalStorageIsSet(true);
      }
      if (incoming.get(12)) {
        struct.spill_read_bytes_from_local_storage = iprot.readI64();
        struct.setSpillReadBytesFromLocalStorageIsSet(true);
      }
      if (incoming.get(13)) {
        struct.bytes_write_into_cache = iprot.readI64();
        struct.setBytesWriteIntoCacheIsSet(true);
      }
      if (incoming.get(14)) {
        struct.process_rows = iprot.readI64();
        struct.setProcessRowsIsSet(true);
      }
      if (incoming.get(15)) {
        struct.finished_tasks_num = iprot.readI32();
        struct.setFinishedTasksNumIsSet(true);
      }
      if (incoming.get(16)) {
        struct.total_tasks_num = iprot.readI32();
        struct.setTotalTasksNumIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}