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


Java TableDataInsertAllRequest.Rows方法代码示例

本文整理汇总了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();
}
 
开发者ID:omerio,项目名称:ecarf,代码行数:24,代码来源:TestBigqueryStreaming.java

示例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;
}
 
开发者ID:DevOps-TangoMe,项目名称:flume-bigquery,代码行数:17,代码来源:GoogleBigQuerySink.java

示例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();
  
}
 
开发者ID:googlearchive,项目名称:bigquery-samples-python,代码行数:14,代码来源:StreamingSample.java

示例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;
}
 
开发者ID:DevOps-TangoMe,项目名称:flume-bigquery,代码行数:33,代码来源:InsertRequestRowsBuilderFactory.java

示例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;
}
 
开发者ID:RobinUS2,项目名称:cloudpelican-lsd,代码行数:6,代码来源:BigQueryInsertRunnable.java

示例6: createRows

import com.google.api.services.bigquery.model.TableDataInsertAllRequest; //导入方法依赖的package包/类
TableDataInsertAllRequest.Rows createRows(Event event); 
开发者ID:DevOps-TangoMe,项目名称:flume-bigquery,代码行数:2,代码来源:IInsertRequestRowsBuilderFactory.java


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