Exemplo n.º 1
0
  /** Performs a deep copy on <i>other</i>. */
  public Table(Table other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetTableName()) {
      this.tableName = other.tableName;
    }
    if (other.isSetDbName()) {
      this.dbName = other.dbName;
    }
    if (other.isSetOwner()) {
      this.owner = other.owner;
    }
    this.createTime = other.createTime;
    this.lastAccessTime = other.lastAccessTime;
    this.retention = other.retention;
    if (other.isSetSd()) {
      this.sd = new StorageDescriptor(other.sd);
    }
    if (other.isSetPartitionKeys()) {
      List<FieldSchema> __this__partitionKeys = new ArrayList<FieldSchema>();
      for (FieldSchema other_element : other.partitionKeys) {
        __this__partitionKeys.add(new FieldSchema(other_element));
      }
      this.partitionKeys = __this__partitionKeys;
    }
    if (other.isSetParameters()) {
      Map<String, String> __this__parameters = new HashMap<String, String>();
      for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {

        String other_element_key = other_element.getKey();
        String other_element_value = other_element.getValue();

        String __this__parameters_copy_key = other_element_key;

        String __this__parameters_copy_value = other_element_value;

        __this__parameters.put(__this__parameters_copy_key, __this__parameters_copy_value);
      }
      this.parameters = __this__parameters;
    }
    if (other.isSetViewOriginalText()) {
      this.viewOriginalText = other.viewOriginalText;
    }
    if (other.isSetViewExpandedText()) {
      this.viewExpandedText = other.viewExpandedText;
    }
    if (other.isSetTableType()) {
      this.tableType = other.tableType;
    }
    if (other.isSetPrivileges()) {
      this.privileges = new PrincipalPrivilegeSet(other.privileges);
    }
  }
Exemplo n.º 2
0
  public boolean equals(Table that) {
    if (that == null) return false;

    boolean this_present_tableName = true && this.isSetTableName();
    boolean that_present_tableName = true && that.isSetTableName();
    if (this_present_tableName || that_present_tableName) {
      if (!(this_present_tableName && that_present_tableName)) return false;
      if (!this.tableName.equals(that.tableName)) return false;
    }

    boolean this_present_dbName = true && this.isSetDbName();
    boolean that_present_dbName = true && that.isSetDbName();
    if (this_present_dbName || that_present_dbName) {
      if (!(this_present_dbName && that_present_dbName)) return false;
      if (!this.dbName.equals(that.dbName)) return false;
    }

    boolean this_present_owner = true && this.isSetOwner();
    boolean that_present_owner = true && that.isSetOwner();
    if (this_present_owner || that_present_owner) {
      if (!(this_present_owner && that_present_owner)) return false;
      if (!this.owner.equals(that.owner)) return false;
    }

    boolean this_present_createTime = true;
    boolean that_present_createTime = true;
    if (this_present_createTime || that_present_createTime) {
      if (!(this_present_createTime && that_present_createTime)) return false;
      if (this.createTime != that.createTime) return false;
    }

    boolean this_present_lastAccessTime = true;
    boolean that_present_lastAccessTime = true;
    if (this_present_lastAccessTime || that_present_lastAccessTime) {
      if (!(this_present_lastAccessTime && that_present_lastAccessTime)) return false;
      if (this.lastAccessTime != that.lastAccessTime) return false;
    }

    boolean this_present_retention = true;
    boolean that_present_retention = true;
    if (this_present_retention || that_present_retention) {
      if (!(this_present_retention && that_present_retention)) return false;
      if (this.retention != that.retention) return false;
    }

    boolean this_present_sd = true && this.isSetSd();
    boolean that_present_sd = true && that.isSetSd();
    if (this_present_sd || that_present_sd) {
      if (!(this_present_sd && that_present_sd)) return false;
      if (!this.sd.equals(that.sd)) return false;
    }

    boolean this_present_partitionKeys = true && this.isSetPartitionKeys();
    boolean that_present_partitionKeys = true && that.isSetPartitionKeys();
    if (this_present_partitionKeys || that_present_partitionKeys) {
      if (!(this_present_partitionKeys && that_present_partitionKeys)) return false;
      if (!this.partitionKeys.equals(that.partitionKeys)) return false;
    }

    boolean this_present_parameters = true && this.isSetParameters();
    boolean that_present_parameters = true && that.isSetParameters();
    if (this_present_parameters || that_present_parameters) {
      if (!(this_present_parameters && that_present_parameters)) return false;
      if (!this.parameters.equals(that.parameters)) return false;
    }

    boolean this_present_viewOriginalText = true && this.isSetViewOriginalText();
    boolean that_present_viewOriginalText = true && that.isSetViewOriginalText();
    if (this_present_viewOriginalText || that_present_viewOriginalText) {
      if (!(this_present_viewOriginalText && that_present_viewOriginalText)) return false;
      if (!this.viewOriginalText.equals(that.viewOriginalText)) return false;
    }

    boolean this_present_viewExpandedText = true && this.isSetViewExpandedText();
    boolean that_present_viewExpandedText = true && that.isSetViewExpandedText();
    if (this_present_viewExpandedText || that_present_viewExpandedText) {
      if (!(this_present_viewExpandedText && that_present_viewExpandedText)) return false;
      if (!this.viewExpandedText.equals(that.viewExpandedText)) return false;
    }

    boolean this_present_tableType = true && this.isSetTableType();
    boolean that_present_tableType = true && that.isSetTableType();
    if (this_present_tableType || that_present_tableType) {
      if (!(this_present_tableType && that_present_tableType)) return false;
      if (!this.tableType.equals(that.tableType)) return false;
    }

    boolean this_present_privileges = true && this.isSetPrivileges();
    boolean that_present_privileges = true && that.isSetPrivileges();
    if (this_present_privileges || that_present_privileges) {
      if (!(this_present_privileges && that_present_privileges)) return false;
      if (!this.privileges.equals(that.privileges)) return false;
    }

    return true;
  }
Exemplo n.º 3
0
  public int compareTo(Table other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    Table typedOther = (Table) other;

    lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.tableName, typedOther.tableName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDbName()).compareTo(typedOther.isSetDbName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dbName, typedOther.dbName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOwner()).compareTo(typedOther.isSetOwner());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwner()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, typedOther.owner);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(typedOther.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.createTime, typedOther.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetLastAccessTime()).compareTo(typedOther.isSetLastAccessTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastAccessTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastAccessTime, typedOther.lastAccessTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRetention()).compareTo(typedOther.isSetRetention());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRetention()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.retention, typedOther.retention);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSd()).compareTo(typedOther.isSetSd());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSd()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sd, typedOther.sd);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetPartitionKeys()).compareTo(typedOther.isSetPartitionKeys());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionKeys()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.partitionKeys, typedOther.partitionKeys);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParameters()).compareTo(typedOther.isSetParameters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameters()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.parameters, typedOther.parameters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetViewOriginalText()).compareTo(typedOther.isSetViewOriginalText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetViewOriginalText()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.viewOriginalText, typedOther.viewOriginalText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetViewExpandedText()).compareTo(typedOther.isSetViewExpandedText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetViewExpandedText()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.viewExpandedText, typedOther.viewExpandedText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTableType()).compareTo(typedOther.isSetTableType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableType()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.tableType, typedOther.tableType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivileges()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.privileges, typedOther.privileges);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }