org.apache.pig.ResourceSchema.fieldNames()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(164)

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

ResourceSchema.fieldNames介绍

[英]Get all field names.
[中]获取所有字段名。

代码示例

代码示例来源:origin: infochimps-labs/wonderdog

/**
  Check that schema is reasonable and serialize the field names as a string for later use.
 */
@Override
public void checkSchema(ResourceSchema s) throws IOException {
  UDFContext context  = UDFContext.getUDFContext();
  Properties property = context.getUDFProperties(ResourceSchema.class);
  String fieldNames   = "";       
  for (String field : s.fieldNames()) {
    fieldNames += field;
    fieldNames += COMMA;
  }
  property.setProperty(PIG_ES_FIELD_NAMES, fieldNames);
}

代码示例来源:origin: infochimps-labs/wonderdog

/**
  Here we set the field names for a given tuple even if we 
 */
@Override
public void checkSchema(ResourceSchema s) throws IOException {
  UDFContext context  = UDFContext.getUDFContext();
  Properties property = context.getUDFProperties(ResourceSchema.class);
  String fieldNames   = "";       
  for (String field : s.fieldNames()) {
    fieldNames += field;
    fieldNames += COMMA;
  }
  property.setProperty(PIG_ES_FIELD_NAMES, fieldNames);
}

代码示例来源:origin: org.apache.pig/pig

OutputStream os = headerFilePath.create();
try {
  String[] names = schema.fieldNames();
  String fn;
  for (int i=0; i < names.length; i++) {

相关文章