Skip to content

Commit

Permalink
Merge pull request #367 from mziccard/bigquery
Browse files Browse the repository at this point in the history
Add BigQueryRpc default implementation
  • Loading branch information
aozarov committed Nov 24, 2015
2 parents 13e976a + 120fe12 commit 762fa58
Show file tree
Hide file tree
Showing 2 changed files with 454 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public interface BigQueryRpc {

// These options are part of the Google Cloud BigQuery query parameters
enum Option {
QUOTA_USER("quotaUser"),
USER_IP("userIp"),
FIELDS("fields"),
DELETE_CONTENTS("deleteContents"),
ALL_DATASETS("all"),
Expand Down Expand Up @@ -98,23 +96,57 @@ public Y y() {
}
}

/**
* Returns the requested dataset or {@code null} if not found.
*
* @throws BigQueryException upon failure
*/
Dataset getDataset(String datasetId, Map<Option, ?> options) throws BigQueryException;

/**
* Lists the project's datasets. Partial information is returned on a dataset (datasetReference,
* friendlyName and id). To get full information use {@link #getDataset(String, Map)}.
*
* @throws BigQueryException upon failure
*/
Tuple<String, Iterable<Dataset>> listDatasets(Map<Option, ?> options) throws BigQueryException;

Dataset create(Dataset dataset, Map<Option, ?> options) throws BigQueryException;

/**
* Delete the requested dataset.
*
* @return {@code true} if dataset was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean deleteDataset(String datasetId, Map<Option, ?> options) throws BigQueryException;

Dataset patch(Dataset dataset, Map<Option, ?> options) throws BigQueryException;

/**
* Returns the requested table or {@code null} if not found.
*
* @throws BigQueryException upon failure
*/
Table getTable(String datasetId, String tableId, Map<Option, ?> options) throws BigQueryException;

/**
* Lists the dataset's tables. Partial information is returned on a table (tableReference,
* friendlyName, id and type). To get full information use {@link #getTable(String, String, Map)}.
*
* @throws BigQueryException upon failure
*/
Tuple<String, Iterable<Table>> listTables(String dataset, Map<Option, ?> options)
throws BigQueryException;

Table create(Table table, Map<Option, ?> options) throws BigQueryException;

/**
* Delete the requested table.
*
* @return {@code true} if table was deleted, {@code false} if it was not found
* @throws BigQueryException upon failure
*/
boolean deleteTable(String datasetId, String tableId, Map<Option, ?> options)
throws BigQueryException;

Expand All @@ -126,8 +158,18 @@ TableDataInsertAllResponse insertAll(TableReference table, TableDataInsertAllReq
Tuple<String, Iterable<TableRow>> listTableData(String datasetId, String tableId,
Map<Option, ?> options) throws BigQueryException;

/**
* Returns the requested job or {@code null} if not found.
*
* @throws BigQueryException upon failure
*/
Job getJob(String jobId, Map<Option, ?> options) throws BigQueryException;

/**
* Lists the project's jobs.
*
* @throws BigQueryException upon failure
*/
Tuple<String, Iterable<Job>> listJobs(Map<Option, ?> options) throws BigQueryException;

Job create(Job job, Map<Option, ?> options) throws BigQueryException;
Expand Down
Loading

0 comments on commit 762fa58

Please sign in to comment.