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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetQueryId(), other.isSetQueryId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryType(), other.isSetQueryType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryType, other.queryType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryAttributes(), other.isSetQueryAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryAttributes, other.queryAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetQueryCounters(), other.isSetQueryCounters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueryCounters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryCounters, other.queryCounters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStageGraph(), other.isSetStageGraph());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStageGraph()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageGraph, other.stageGraph);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStageList(), other.isSetStageList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStageList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageList, other.stageList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDone(), other.isSetDone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDone()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.done, other.done);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStarted(), other.isSetStarted());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStarted()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.started, other.started);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise
ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java