本文整理了Java中com.google.api.services.bigquery.model.TableRow.entrySet()
方法的一些代码示例,展示了TableRow.entrySet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableRow.entrySet()
方法的具体详情如下:
包路径:com.google.api.services.bigquery.model.TableRow
类名称:TableRow
方法名:entrySet
暂无
代码示例来源:origin: GoogleCloudPlatform/cloud-bigtable-examples
@ProcessElement
public void processElement(DoFn<TableRow, Mutation>.ProcessContext c) throws Exception {
TableRow row = c.element();
//Use UUID for each HBase item's row key
Put p = new Put(java.util.UUID.randomUUID().toString().getBytes());
for (Map.Entry<String, Object> field : row.entrySet()) {
p.addColumn(FAMILY, field.getKey().getBytes(), ((String) field.getValue()).getBytes());
}
c.output(p);
}
};
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform
static TableRow convertNumbers(TableRow tableRow) {
for (TableRow.Entry entry : tableRow.entrySet()) {
if (entry.getValue() instanceof Integer) {
entry.setValue(Long.valueOf((Integer) entry.getValue()));
}
}
return tableRow;
}
}
代码示例来源:origin: yu-iskw/bigquery-to-datastore
/**
* Convert TableRow to Entity
*
* @param row TableRow of bigquery
* @return converted Entity
* @throws ParseException
*/
public Entity convertTableRowToEntity(TableRow row) throws ParseException {
String keyName = row.get(keyColumn).toString();
Key key = getKey(keyName);
Entity.Builder builder = Entity.newBuilder().setKey(key);
Set<Map.Entry<String, Object>> entries = row.entrySet();
for (Map.Entry<String, Object> entry : entries) {
// Skip on the key column
if (entry.getKey().equals(keyColumn)) {
continue;
}
// Put a value in the builder
String propertyName = entry.getKey();
Object value = entry.getValue();
Value v = convertToDatastoreValue(propertyName, value);
if (v != null) {
builder.putProperties(propertyName, v);
}
}
return builder.build();
}
代码示例来源:origin: org.apache.beam/beam-examples-java
static String canonicalFormat(TableRow row) {
List<String> entries = Lists.newArrayListWithCapacity(row.size());
for (Map.Entry<String, Object> entry : row.entrySet()) {
entries.add(entry.getKey() + ":" + entry.getValue());
}
Collections.sort(entries);
return Joiner.on(",").join(entries);
}
内容来源于网络,如有侵权,请联系作者删除!