本文整理汇总了Java中com.google.api.services.bigquery.model.TableDataInsertAllRequest.Rows方法的典型用法代码示例。如果您正苦于以下问题:Java TableDataInsertAllRequest.Rows方法的具体用法?Java TableDataInsertAllRequest.Rows怎么用?Java TableDataInsertAllRequest.Rows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.api.services.bigquery.model.TableDataInsertAllRequest
的用法示例。
在下文中一共展示了TableDataInsertAllRequest.Rows方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
@Test
public void test() throws IOException {
String projectId = "";
String datasetId = "ontologies";
String tableId = "";
String timestamp = Long.toString((new Date()).getTime());
Bigquery bigquery = null;
TableRow row = new TableRow();
row.set("column_name", 7.7);
TableDataInsertAllRequest.Rows rows = new TableDataInsertAllRequest.Rows();
rows.setInsertId(timestamp);
rows.setJson(row);
List rowList =
new ArrayList();
rowList.add(rows);
TableDataInsertAllRequest content =
new TableDataInsertAllRequest().setRows(rowList);
TableDataInsertAllResponse response =
bigquery.tabledata().insertAll(
projectId, datasetId, tableId, content).execute();
}
示例2: createRows
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
protected TableDataInsertAllRequest.Rows createRows(Event event) {
TableDataInsertAllRequest.Rows insertRequestRows = null;
try {
insertRequestRows = insertRequestRowsBuilderFactory.createRows(event);
if (logger.isDebugEnabled()) {
if (insertRequestRows != null) {
logger.debug("Row created from event '%s': %s", event, insertRequestRows.toPrettyString());
} else {
logger.debug("No row created from event '%s'", event);
}
}
} catch (Exception ex) {
logger.warn(String.format("Error creating rows from event '%s': %s. Skipping it.", event, ex.getMessage()), ex);
}
return insertRequestRows;
}
示例3: streamRow
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
public static TableDataInsertAllResponse streamRow(Bigquery bigquery,
String projectId,
String datasetId,
String tableId,
TableDataInsertAllRequest.Rows row) throws IOException{
return bigquery.tabledata().insertAll(
projectId,
datasetId,
tableId,
new TableDataInsertAllRequest().setRows(Collections.singletonList(row))).execute();
}
示例4: createRows
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
@Override
public TableDataInsertAllRequest.Rows createRows(Event event) {
TableDataInsertAllRequest.Rows result = null;
if (event != null) {
TableRow row = new TableRow();
Map<String, String> headers = new LinkedHashMap<String, String>(event.getHeaders());
if (!headers.isEmpty()) {
String id = idHeaderName != null ? headers.get(idHeaderName) : null;
for (Map.Entry<String, String> headerEntry : headers.entrySet()) {
String headerName = headerEntry.getKey();
if (!excludeHeaders.isEmpty() && excludeHeaders.contains(headerName)) {
continue;
}
String columnName = includeHeadersRenameMap.get(headerName);
if (!excludeHeaders.isEmpty() || columnName != null || includeHeadersRenameMap.isEmpty()) {
row = setColumnValue(row, columnName == null ? headerName : columnName, headerEntry.getValue());
if (row == null) {
break;
}
}
}
if (row != null) {
result = new TableDataInsertAllRequest.Rows();
if (StringUtils.isNotBlank(id)) {
result.setInsertId(id);
}
result.setJson(row);
}
}
}
return result;
}
示例5: BigQueryInsertRunnable
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
public BigQueryInsertRunnable(BigQuerySinkBolt parent, String filterId, ArrayList<TableDataInsertAllRequest.Rows> rows) {
this.parent = parent;
this.filterId = filterId;
this.rows = rows;
}
示例6: createRows
import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
TableDataInsertAllRequest.Rows createRows(Event event);