当前位置: 首页>>代码示例>>Java>>正文


Java GbifTerm.gbifID方法代码示例

本文整理汇总了Java中org.gbif.dwc.terms.GbifTerm.gbifID方法的典型用法代码示例。如果您正苦于以下问题:Java GbifTerm.gbifID方法的具体用法?Java GbifTerm.gbifID怎么用?Java GbifTerm.gbifID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gbif.dwc.terms.GbifTerm的用法示例。


在下文中一共展示了GbifTerm.gbifID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectVerbatimFields

import org.gbif.dwc.terms.GbifTerm; //导入方法依赖的package包/类
/**
 * @return the select fields for the verbatim table in the simple download
 */
static List<InitializableField> selectVerbatimFields() {
  ImmutableList.Builder<InitializableField> builder = ImmutableList.builder();
  // always add the GBIF ID
  builder.add(new InitializableField(GbifTerm.gbifID,
                                     HiveColumns.columnFor(GbifTerm.gbifID),
                                     HiveDataTypes.typeForTerm(GbifTerm.gbifID, true)));

  for (Term term : DownloadTerms.DOWNLOAD_VERBATIM_TERMS) {
    if (GbifTerm.gbifID == term) {
      continue; // for safety, we code defensively as it may be added
    }

    builder.add(new InitializableField(term,
                                       HiveColumns.VERBATIM_COL_PREFIX + term.simpleName().toLowerCase(),
                                       // no escape needed due to prefix
                                       HiveDataTypes.TYPE_STRING));
  }
  return builder.build();
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:23,代码来源:Queries.java

示例2: selectDownloadFields

import org.gbif.dwc.terms.GbifTerm; //导入方法依赖的package包/类
/**
 * @return the select fields for the interpreted table in the simple download
 */
private static List<InitializableField> selectDownloadFields(Set<Term> terms, boolean useInitializers) {
  ImmutableList.Builder<InitializableField> builder = ImmutableList.builder();
  // always add the GBIF ID
  builder.add(new InitializableField(GbifTerm.gbifID,
                                     HiveColumns.columnFor(GbifTerm.gbifID),
                                     HiveDataTypes.typeForTerm(GbifTerm.gbifID, true)));

  for (Term term : terms) {
    if (GbifTerm.gbifID == term) {
      continue; // for safety, we code defensively as it may be added
    }
    if (useInitializers && TermUtils.isInterpretedDate(term)) {
      builder.add(new InitializableField(term, toISO8601Initializer(term), HiveDataTypes.TYPE_STRING));
    } else if (useInitializers && HiveColumnsUtils.isHiveArray(term)){
      builder.add(new InitializableField(term, String.format(JOIN_ARRAY_FMT,HiveColumns.columnFor(term)), HiveDataTypes.TYPE_STRING));
    } else {
      builder.add(new InitializableField(term, HiveColumns.columnFor(term), HiveDataTypes.TYPE_STRING));
    }
  }
  return builder.build();
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:25,代码来源:Queries.java

示例3: typeForTerm

import org.gbif.dwc.terms.GbifTerm; //导入方法依赖的package包/类
/**
 * Provides the Hive data type to use for the given term and context (e.g. verbatim or interpreted) that it is being
 * used.
 *
 * @param term            to retrive the type for
 * @param verbatimContext true if the term is being used in the verbatim context, otherwise false
 *
 * @return The correct hive type for the term in the context in which it is being used
 */
public static String typeForTerm(Term term, boolean verbatimContext) {
  // regardless of context, the GBIF ID is always typed
  if (GbifTerm.gbifID == term) {
    return TYPED_TERMS.get(GbifTerm.gbifID);

  } else if (verbatimContext) {
    return TYPE_STRING; // verbatim are always string

  } else {
    return TYPED_TERMS.containsKey(term)
      ? TYPED_TERMS.get(term)
      : TYPE_STRING; // interpreted term with a registered type

  }
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:25,代码来源:HiveDataTypes.java

示例4: keyField

import org.gbif.dwc.terms.GbifTerm; //导入方法依赖的package包/类
/**
 * Constructs the field for the primary key, which is a special case in that it needs a special mapping.
 */
private static InitializableField keyField() {
  return new InitializableField(GbifTerm.gbifID,
                                HiveColumns.columnFor(GbifTerm.gbifID),
                                HiveDataTypes.typeForTerm(GbifTerm.gbifID, true)
                                // verbatim context
  );
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:11,代码来源:OccurrenceHDFSTableDefinition.java

示例5: keyField

import org.gbif.dwc.terms.GbifTerm; //导入方法依赖的package包/类
/**
 * Constructs the field for the primary key, which is a special case in that it needs a special mapping.
 */
private static HBaseField keyField() {
  return new HBaseField(GbifTerm.gbifID,
                        HiveColumns.columnFor(GbifTerm.gbifID),
                        HiveDataTypes.typeForTerm(GbifTerm.gbifID, true),
                        HBASE_KEY_MAPPING
                        // special(!) mapping just for key
  );
}
 
开发者ID:gbif,项目名称:occurrence,代码行数:12,代码来源:OccurrenceHBaseTableDefinition.java


注:本文中的org.gbif.dwc.terms.GbifTerm.gbifID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。