本文整理汇总了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;
}
示例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;
}
示例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));
}
}
示例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);
}
}
示例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();
}
}
示例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));
}
示例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")));
}
}
示例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;
}
示例9: extractPostIdFromRedditPost
import com.google.api.services.bigquery.model.TableRow; //导入方法依赖的package包/类
public static String extractPostIdFromRedditPost(TableRow post) {
return "t3_" + (String) post.get("id");
}
示例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>
}