Codota Logo
com.google.cloud.bigquery
Code IndexAdd Codota to your IDE (free)

How to use com.google.cloud.bigquery

Best Java code snippets using com.google.cloud.bigquery (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: googleapis/google-cloud-java

@Override
public TableDataWriteChannel writer(
  JobId jobId, WriteChannelConfiguration writeChannelConfiguration) {
 return new TableDataWriteChannel(
   getOptions(),
   jobId.setProjectId(getOptions().getProjectId()),
   writeChannelConfiguration.setProjectId(getOptions().getProjectId()));
}
origin: googleapis/google-cloud-java

JobInfo setProjectId(String projectId) {
 Builder builder = toBuilder();
 if (jobId != null) {
  builder.setJobId(jobId.setProjectId(projectId));
 }
 return builder.setConfiguration(configuration.setProjectId(projectId)).build();
}
origin: googleapis/google-cloud-java

/** Example of updating a dataset by changing its description. */
// [TARGET update(DatasetInfo, DatasetOption...)]
// [VARIABLE "my_dataset_name"]
// [VARIABLE "some_new_description"]
public Dataset updateDataset(String datasetName, String newDescription) {
 // [START bigquery_update_dataset_description]
 Dataset oldDataset = bigquery.getDataset(datasetName);
 DatasetInfo datasetInfo = oldDataset.toBuilder().setDescription(newDescription).build();
 Dataset newDataset = bigquery.update(datasetInfo);
 // [END bigquery_update_dataset_description]
 return newDataset;
}
origin: googleapis/google-cloud-java

 @Override
 protected Restorable<?>[] restorableObjects() {
  BigQueryOptions options = BigQueryOptions.newBuilder().setProjectId("p2").build();
  // avoid closing when you don't want partial writes upon failure
  @SuppressWarnings("resource")
  TableDataWriteChannel writer =
    new TableDataWriteChannel(options, LOAD_CONFIGURATION, "upload-id");
  return new Restorable<?>[] {writer};
 }
}
origin: googleapis/google-cloud-java

/** Example of updating a table by changing its description. */
public Table updateTableDescription(String datasetName, String tableName, String newDescription) {
 // [START bigquery_update_table_description]
 // String datasetName = "my_dataset_name";
 // String tableName = "my_table_name";
 // String newDescription = "new_description";
 Table beforeTable = bigquery.getTable(datasetName, tableName);
 TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build();
 Table afterTable = bigquery.update(tableInfo);
 // [END bigquery_update_table_description]
 return afterTable;
}
origin: googleapis/google-cloud-java

/**
 * Returns a builder for an {@code InsertAllRequest} object given the destination table and the
 * rows to insert.
 */
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) {
 return newBuilder(TableId.of(datasetId, tableId), rows);
}
origin: googleapis/google-cloud-java

@Test
public void testToPbAndFromPb() {
 compareExtractStatistics(
   EXTRACT_STATISTICS, ExtractStatistics.fromPb(EXTRACT_STATISTICS.toPb()));
 compareLoadStatistics(LOAD_STATISTICS, LoadStatistics.fromPb(LOAD_STATISTICS.toPb()));
 compareQueryStatistics(QUERY_STATISTICS, QueryStatistics.fromPb(QUERY_STATISTICS.toPb()));
 compareStatistics(COPY_STATISTICS, CopyStatistics.fromPb(COPY_STATISTICS.toPb()));
 compareLoadStatistics(
   LOAD_STATISTICS_INCOMPLETE, LoadStatistics.fromPb(LOAD_STATISTICS_INCOMPLETE.toPb()));
 compareQueryStatistics(
   QUERY_STATISTICS_INCOMPLETE, QueryStatistics.fromPb(QUERY_STATISTICS_INCOMPLETE.toPb()));
}
origin: googleapis/google-cloud-java

/**
 * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
 */
public static InsertAllRequest of(TableInfo tableInfo, RowToInsert... rows) {
 return newBuilder(tableInfo.getTableId(), rows).build();
}
origin: googleapis/google-cloud-java

@Override
public Page<Table> listTables(String datasetId, TableListOption... options) {
 return listTables(
   DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options));
}
origin: googleapis/google-cloud-java

 @Override
 public Job call() throws Exception {
  return bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS));
 }
},
origin: googleapis/google-cloud-java

@Override
public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... options)
  throws InterruptedException, JobException {
 Job.checkNotDryRun(configuration, "query");
 return create(JobInfo.of(jobId, configuration), options).getQueryResults();
}
origin: googleapis/google-cloud-java

/**
 * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
 */
public static InsertAllRequest of(TableId tableId, Iterable<RowToInsert> rows) {
 return newBuilder(tableId, rows).build();
}
origin: googleapis/google-cloud-java

 @Override
 public boolean shouldRetry(Throwable prevThrowable, Job prevResponse) {
  return prevResponse != null
    && !JobStatus.State.DONE.equals(prevResponse.getStatus().getState());
 }
},
origin: googleapis/google-cloud-java

/**
 * Returns a {@code JobInfo} object given the job configuration. Use {@link CopyJobConfiguration}
 * for a job that copies an existing table. Use {@link ExtractJobConfiguration} for a job that
 * exports a table to Google Cloud Storage. Use {@link LoadJobConfiguration} for a job that loads
 * data from Google Cloud Storage into a table. Use {@link QueryJobConfiguration} for a job that
 * runs a query.
 */
public static JobInfo of(JobConfiguration configuration) {
 return newBuilder(configuration).build();
}
origin: googleapis/google-cloud-java

 @Override
 public Table apply(com.google.api.services.bigquery.model.Table table) {
  return Table.fromPb(serviceOptions.getService(), table);
 }
});
origin: googleapis/google-cloud-java

 static Dataset fromPb(
   BigQuery bigquery, com.google.api.services.bigquery.model.Dataset datasetPb) {
  return new Dataset(bigquery, new DatasetInfo.BuilderImpl(datasetPb));
 }
}
origin: googleapis/google-cloud-java

/**
 * Returns a BigQuery Extract Job configuration for the given source table and destination URI.
 */
public static ExtractJobConfiguration of(TableId sourceTable, String destinationUri) {
 return newBuilder(sourceTable, destinationUri).build();
}
origin: googleapis/google-cloud-java

/**
 * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
 */
public static InsertAllRequest of(TableInfo tableInfo, Iterable<RowToInsert> rows) {
 return newBuilder(tableInfo.getTableId(), rows).build();
}
origin: googleapis/google-cloud-java

@Override
public TableResult query(QueryJobConfiguration configuration, JobOption... options)
  throws InterruptedException, JobException {
 Job.checkNotDryRun(configuration, "query");
 return create(JobInfo.of(configuration), options).getQueryResults();
}
origin: googleapis/google-cloud-java

/**
 * Returns a {@code InsertAllRequest} object given the destination table and the rows to insert.
 */
public static InsertAllRequest of(String datasetId, String tableId, RowToInsert... rows) {
 return newBuilder(datasetId, tableId, rows).build();
}
com.google.cloud.bigquery

Most used classes

  • BigQuery
    An interface for Google Cloud BigQuery.
  • TableId
    Google BigQuery Table identity.
  • BigQueryOptions$Builder
  • BigQueryOptions
  • Field
    Google BigQuery Table schema field. A table field has a name, a type, a mode and possibly a descript
  • Job,
  • Dataset,
  • DatasetInfo,
  • JobInfo,
  • TableInfo,
  • BigQueryError,
  • BigQueryException,
  • Field$Builder,
  • QueryJobConfiguration$Builder,
  • QueryJobConfiguration,
  • StandardTableDefinition,
  • TableInfo$Builder,
  • DatasetId,
  • DatasetInfo$Builder
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now