org.apache.hadoop.hive.metastore.api.Partition.isSetParameters()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.apache.hadoop.hive.metastore.api.Partition.isSetParameters()方法的一些代码示例,展示了Partition.isSetParameters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Partition.isSetParameters()方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Partition
类名称:Partition
方法名:isSetParameters

Partition.isSetParameters介绍

[英]Returns true if field parameters is set (has been assigned a value) and false otherwise
[中]如果设置了字段参数(已指定值),则返回true,否则返回false

代码示例

代码示例来源:origin: apache/hive

/**
 * Determines whether the "fast stats" for the passed partitions are the same.
 *
 * @param oldPart Old partition to compare.
 * @param newPart New partition to compare.
 * @return true if the partitions are not null, contain all the "fast stats" and have the same values for these stats, otherwise false.
 */
public static boolean isFastStatsSame(Partition oldPart, Partition newPart) {
 // requires to calculate stats if new and old have different fast stats
 if ((oldPart != null) && oldPart.isSetParameters() && newPart != null && newPart.isSetParameters()) {
  for (String stat : StatsSetupConst.FAST_STATS) {
   if (oldPart.getParameters().containsKey(stat) && newPart.getParameters().containsKey(stat)) {
    Long oldStat = Long.parseLong(oldPart.getParameters().get(stat));
    String newStat = newPart.getParameters().get(stat);
    if (newStat == null || !oldStat.equals(Long.parseLong(newStat))) {
     return false;
    }
   } else {
    return false;
   }
  }
  return true;
 }
 return false;
}

代码示例来源:origin: apache/hive

list.add(sd);
boolean present_parameters = true && (isSetParameters());
list.add(present_parameters);
if (present_parameters)

代码示例来源:origin: apache/incubator-gobblin

@VisibleForTesting
public static long getCreateTime(Partition partition) {
 // If create time is set, use it.
 // .. this is always set if HiveJDBC or Hive mestastore is used to create partition.
 // .. it might not be set (ie. equals 0) if Thrift API call is used to create partition.
 if (partition.getTPartition().getCreateTime() > 0) {
  return TimeUnit.MILLISECONDS.convert(partition.getTPartition().getCreateTime(), TimeUnit.SECONDS);
 }
 // Try to use distcp-ng registration generation time if it is available
 else if (partition.getTPartition().isSetParameters()
   && partition.getTPartition().getParameters().containsKey(DISTCP_REGISTRATION_GENERATION_TIME_KEY)) {
  log.debug("Did not find createTime in Hive partition, used distcp registration generation time.");
  return Long.parseLong(partition.getTPartition().getParameters().get(DISTCP_REGISTRATION_GENERATION_TIME_KEY));
 } else {
  log.warn(String.format("Could not find create time for partition %s. Will return createTime as 0",
    partition.getCompleteName()));
  return 0;
 }
}

代码示例来源:origin: apache/hive

lastComparison = Boolean.valueOf(isSetParameters()).compareTo(other.isSetParameters());
if (lastComparison != 0) {
 return lastComparison;
if (isSetParameters()) {
 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
 if (lastComparison != 0) {

代码示例来源:origin: apache/hive

optionals.set(5);
if (struct.isSetParameters()) {
 optionals.set(6);
 struct.sd.write(oprot);
if (struct.isSetParameters()) {

代码示例来源:origin: apache/hive

return isSetSd();
case PARAMETERS:
 return isSetParameters();
case PRIVILEGES:
 return isSetPrivileges();

代码示例来源:origin: apache/hive

this.sd = new StorageDescriptor(other.sd);
if (other.isSetParameters()) {
 Map<String,String> __this__parameters = new HashMap<String,String>(other.parameters);
 this.parameters = __this__parameters;

代码示例来源:origin: apache/hive

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))

代码示例来源:origin: org.spark-project.hive/hive-metastore

builder.append(sd);
boolean present_parameters = true && (isSetParameters());
builder.append(present_parameters);
if (present_parameters)

代码示例来源:origin: com.linkedin.gobblin/gobblin-data-management

@VisibleForTesting
public static long getCreateTime(Partition partition) {
 // If create time is set, use it.
 // .. this is always set if HiveJDBC or Hive mestastore is used to create partition.
 // .. it might not be set (ie. equals 0) if Thrift API call is used to create partition.
 if (partition.getTPartition().getCreateTime() > 0) {
  return TimeUnit.MILLISECONDS.convert(partition.getTPartition().getCreateTime(), TimeUnit.SECONDS);
 }
 // Try to use distcp-ng registration generation time if it is available
 else if (partition.getTPartition().isSetParameters()
   && partition.getTPartition().getParameters().containsKey(DISTCP_REGISTRATION_GENERATION_TIME_KEY)) {
  log.debug("Did not find createTime in Hive partition, used distcp registration generation time.");
  return Long.parseLong(partition.getTPartition().getParameters().get(DISTCP_REGISTRATION_GENERATION_TIME_KEY));
 } else {
  log.warn(String.format("Could not find create time for partition %s. Will return createTime as 0",
    partition.getCompleteName()));
  return 0;
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-data-management

@VisibleForTesting
public static long getCreateTime(Partition partition) {
 // If create time is set, use it.
 // .. this is always set if HiveJDBC or Hive mestastore is used to create partition.
 // .. it might not be set (ie. equals 0) if Thrift API call is used to create partition.
 if (partition.getTPartition().getCreateTime() > 0) {
  return TimeUnit.MILLISECONDS.convert(partition.getTPartition().getCreateTime(), TimeUnit.SECONDS);
 }
 // Try to use distcp-ng registration generation time if it is available
 else if (partition.getTPartition().isSetParameters()
   && partition.getTPartition().getParameters().containsKey(DISTCP_REGISTRATION_GENERATION_TIME_KEY)) {
  log.debug("Did not find createTime in Hive partition, used distcp registration generation time.");
  return Long.parseLong(partition.getTPartition().getParameters().get(DISTCP_REGISTRATION_GENERATION_TIME_KEY));
 } else {
  log.warn(String.format("Could not find create time for partition %s. Will return createTime as 0",
    partition.getCompleteName()));
  return 0;
 }
}

代码示例来源:origin: org.apache.hadoop.hive/hive-metastore

this.sd = new StorageDescriptor(other.sd);
if (other.isSetParameters()) {
 Map<String,String> __this__parameters = new HashMap<String,String>();
 for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {

代码示例来源:origin: org.spark-project.hive/hive-metastore

this.sd = new StorageDescriptor(other.sd);
if (other.isSetParameters()) {
 Map<String,String> __this__parameters = new HashMap<String,String>();
 for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {

代码示例来源:origin: com.facebook.presto.hive/hive-apache

this.sd = new StorageDescriptor(other.sd);
if (other.isSetParameters()) {
 Map<String,String> __this__parameters = new HashMap<String,String>();
 for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {

代码示例来源:origin: org.apache.hadoop.hive/hive-metastore

/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
 if (field == null) {
  throw new IllegalArgumentException();
 }
 switch (field) {
 case VALUES:
  return isSetValues();
 case DB_NAME:
  return isSetDbName();
 case TABLE_NAME:
  return isSetTableName();
 case CREATE_TIME:
  return isSetCreateTime();
 case LAST_ACCESS_TIME:
  return isSetLastAccessTime();
 case SD:
  return isSetSd();
 case PARAMETERS:
  return isSetParameters();
 case PRIVILEGES:
  return isSetPrivileges();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: org.spark-project.hive/hive-metastore

/** 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 IllegalArgumentException();
 }
 switch (field) {
 case VALUES:
  return isSetValues();
 case DB_NAME:
  return isSetDbName();
 case TABLE_NAME:
  return isSetTableName();
 case CREATE_TIME:
  return isSetCreateTime();
 case LAST_ACCESS_TIME:
  return isSetLastAccessTime();
 case SD:
  return isSetSd();
 case PARAMETERS:
  return isSetParameters();
 case PRIVILEGES:
  return isSetPrivileges();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/** 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 IllegalArgumentException();
 }
 switch (field) {
 case VALUES:
  return isSetValues();
 case DB_NAME:
  return isSetDbName();
 case TABLE_NAME:
  return isSetTableName();
 case CREATE_TIME:
  return isSetCreateTime();
 case LAST_ACCESS_TIME:
  return isSetLastAccessTime();
 case SD:
  return isSetSd();
 case PARAMETERS:
  return isSetParameters();
 case PRIVILEGES:
  return isSetPrivileges();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: org.apache.hadoop.hive/hive-metastore

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))

代码示例来源:origin: org.spark-project.hive/hive-metastore

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))

代码示例来源:origin: com.facebook.presto.hive/hive-apache

builder.append(sd);
boolean present_parameters = true && (isSetParameters());
builder.append(present_parameters);
if (present_parameters)

相关文章

微信公众号

最新文章

更多

Partition类方法