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


Java TableRow.get方法代码示例

本文整理汇总了Java中com.google.api.services.bigquery.model.TableRow.get方法的典型用法代码示例。如果您正苦于以下问题:Java TableRow.get方法的具体用法?Java TableRow.get怎么用?Java TableRow.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.api.services.bigquery.model.TableRow的用法示例。


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

示例1: extractRedditPostMetaFields

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String[] extractRedditPostMetaFields(TableRow post) {
	String[] result = new String[METAFIELDS_REDDIT_NUM_FIELDS];
	
	String domain = post.get("domain").toString();
	if (!domain.startsWith("self.")) {
		result[METAFIELDS_REDDIT_EXTERNALLINK_IDX] = post.get("url").toString();
		result[METAFIELDS_REDDIT_DOMAIN_IDX] = domain;
	} else {
		result[METAFIELDS_REDDIT_EXTERNALLINK_IDX] = METAFIELDS_VALUE_UNVAILABLE;
		result[METAFIELDS_REDDIT_DOMAIN_IDX] = METAFIELDS_VALUE_UNVAILABLE;
	}
	Object oSubreddit = post.get("subreddit");
	if (oSubreddit != null)
		result[METAFIELDS_REDDIT_SUBREDDIT_IDX] = oSubreddit.toString();
	else 
		result[METAFIELDS_REDDIT_SUBREDDIT_IDX] = METAFIELDS_VALUE_UNVAILABLE;
		
	result[METAFIELDS_REDDIT_SCORE_IDX] = post.get("score").toString();
	result[METAFIELDS_REDDIT_POSTID_IDX] = extractPostIdFromRedditPost(post);
	
	return result;
}
 
开发者ID:GoogleCloudPlatform,项目名称:dataflow-opinion-analysis,代码行数:23,代码来源:IndexerPipelineUtils.java

示例2: getTableRowStringFieldIfNotNull

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String getTableRowStringFieldIfNotNull(TableRow r, String field) {
	Object value = r.get(field);
	if (value != null)
		return value.toString();
	else
		return null;
}
 
开发者ID:GoogleCloudPlatform,项目名称:dataflow-opinion-analysis,代码行数:8,代码来源:IndexerPipelineUtils.java

示例3: processElement

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
@ProcessElement
public void processElement(ProcessContext c) {
  TableRow row = c.element();
  int timestamp = (Integer) row.get("timestamp");
  String userName = (String) row.get("contributor_username");
  if (userName != null) {
    // Sets the implicit timestamp field to be used in windowing.
    c.outputWithTimestamp(userName, new Instant(timestamp * 1000L));
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:11,代码来源:TopWikipediaSessions.java

示例4: processElement

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
@ProcessElement
public void processElement(ProcessContext c){
  TableRow row = c.element();
  Integer month;
  month = (Integer) row.get("month");
  if (month.equals(this.monthFilter)) {
    c.output(row);
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:10,代码来源:FilterExamples.java

示例5: processElement

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
@ProcessElement
public void processElement(ProcessContext c){
  TableRow row = c.element();
  String playName = (String) row.get("corpus");
  String word = (String) row.get("word");
  if (word.length() >= MIN_WORD_LENGTH) {
    c.output(KV.of(word, playName));
  } else {
    // Track how many smaller words we're not including. This information will be
    // visible in the Monitoring UI.
    smallerWords.inc();
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:14,代码来源:CombinePerKeyExamples.java

示例6: processElement

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
@ProcessElement
public void processElement(ProcessContext c) {
  TableRow row = c.element();
  String countryCode = (String) row.get("ActionGeo_CountryCode");
  String sqlDate = (String) row.get("SQLDATE");
  String actor1Name = (String) row.get("Actor1Name");
  String sourceUrl = (String) row.get("SOURCEURL");
  String eventInfo = "Date: " + sqlDate + ", Actor1: " + actor1Name + ", url: " + sourceUrl;
  c.output(KV.of(countryCode, eventInfo));
}
 
开发者ID:apache,项目名称:beam,代码行数:11,代码来源:JoinExamples.java

示例7: processElement

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
@ProcessElement
public void processElement(ProcessContext c){
  TableRow row = c.element();
  if ((Boolean) row.get("tornado")) {
    c.output(Integer.parseInt((String) row.get("month")));
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:8,代码来源:BigQueryTornadoes.java

示例8: extractRedditCommentMetaFields

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String[] extractRedditCommentMetaFields(TableRow comment) {
	
	String[] result = new String[METAFIELDS_REDDIT_NUM_FIELDS];
	
	result[METAFIELDS_REDDIT_EXTERNALLINK_IDX] = METAFIELDS_VALUE_UNVAILABLE;
	result[METAFIELDS_REDDIT_DOMAIN_IDX] = METAFIELDS_VALUE_UNVAILABLE;
	
	Object oSubreddit = comment.get("subreddit");
	if (oSubreddit != null)
		result[METAFIELDS_REDDIT_SUBREDDIT_IDX] = oSubreddit.toString();
	else
		result[METAFIELDS_REDDIT_SUBREDDIT_IDX] = METAFIELDS_VALUE_UNVAILABLE;
	
	result[METAFIELDS_REDDIT_SCORE_IDX] = comment.get("score").toString();
	result[METAFIELDS_REDDIT_POSTID_IDX] = extractPostIdFromRedditComment(comment);
	
	return result;
	
}
 
开发者ID:GoogleCloudPlatform,项目名称:dataflow-opinion-analysis,代码行数:20,代码来源:IndexerPipelineUtils.java

示例9: extractPostIdFromRedditPost

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String extractPostIdFromRedditPost(TableRow post) {
	return "t3_" + (String) post.get("id");
}
 
开发者ID:GoogleCloudPlatform,项目名称:dataflow-opinion-analysis,代码行数:4,代码来源:IndexerPipelineUtils.java

示例10: extractPostIdFromRedditComment

import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String extractPostIdFromRedditComment(TableRow comment) {
	return (String) comment.get("link_id");
	// link_id in comments is already in the format t3_<postId>
}
 
开发者ID:GoogleCloudPlatform,项目名称:dataflow-opinion-analysis,代码行数:5,代码来源:IndexerPipelineUtils.java


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