Package com.google.api.services.bigquery.model

Examples of com.google.api.services.bigquery.model.TableDataInsertAllResponse


      requestRow.setInsertId(insertId);
      rowList.add(requestRow);
    }

    TableDataInsertAllRequest content = new TableDataInsertAllRequest().setRows(rowList);
    TableDataInsertAllResponse response = bigquery.tabledata().insertAll(projectId, datasetId, tableId, content).execute();
    
    if (response.getInsertErrors() != null && response.getInsertErrors().size() > 0) {
      logInsertErrors(response.getInsertErrors(), rows);
    }
   
    return response;
  }
View Full Code Here


  /** Exports metrics to BigQuery. */
  @Override
  public void run() {
    try {
      TableDataInsertAllResponse response = bigquery.tabledata()
          .insertAll(projectId, DATASET_ID, TABLE_ID, new TableDataInsertAllRequest()
              .setRows(ImmutableList.of(new TableDataInsertAllRequest.Rows()
                  .setInsertId(insertId)
                  .setJson(new ImmutableMap.Builder<String, Object>()
                      .put("path", path)
                      .put("method", method)
                      .put("tld", tld)
                      .put("start_time", startTime)
                      .put("end_time", endTime)
                      .put("response_code", responseCode)
                      .put("activity", activity)
                      .build())))).execute();
      if (response.getInsertErrors() != null && !response.getInsertErrors().isEmpty()) {
        throw new RuntimeException(Joiner.on('\n').join(FluentIterable
            .from(response.getInsertErrors())
            .transform(new Function<InsertErrors, String>() {
                @Override
                public String apply(InsertErrors error) {
                  try {
                    return error.toPrettyString();
View Full Code Here

TOP

Related Classes of com.google.api.services.bigquery.model.TableDataInsertAllResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.