com.google.api.services.bigquery.model.TableRow.entrySet()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(117)

本文整理了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

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);
}

相关文章