@Override public TableDataList listTableData( String projectId, String datasetId, String tableId, Map<Option, ?> options) { try { return bigquery .tabledata() .list(projectId, datasetId, tableId) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) .setStartIndex( Option.START_INDEX.getLong(options) != null ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) : null) .execute(); } catch (IOException ex) { throw translate(ex); } }
client.tabledata().list(ref.getProjectId(), ref.getDatasetId(), ref.getTableId()); if (pageToken != null) { list.setPageToken(pageToken);
/** * Retrieves table data from a specified set of rows. Requires the READER dataset role. * * Create a request for the method "tabledata.list". * * This request holds the parameters needed by the bigquery server. After setting any optional * parameters, call the {@link List#execute()} method to invoke the remote operation. * * @param projectId Project ID of the table to read * @param datasetId Dataset ID of the table to read * @param tableId Table ID of the table to read * @return the request */ public List list(java.lang.String projectId, java.lang.String datasetId, java.lang.String tableId) throws java.io.IOException { List result = new List(projectId, datasetId, tableId); initialize(result); return result; }
@Override public TableDataList listTableData( String projectId, String datasetId, String tableId, Map<Option, ?> options) { try { return bigquery .tabledata() .list(projectId, datasetId, tableId) .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)) .setStartIndex( Option.START_INDEX.getLong(options) != null ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) : null) .execute(); } catch (IOException ex) { throw translate(ex); } }
@Override public Tuple<String, Iterable<TableRow>> listTableData(String datasetId, String tableId, Map<Option, ?> options) { try { TableDataList tableDataList = bigquery.tabledata() .list(this.options.projectId(), datasetId, tableId) .setMaxResults(MAX_RESULTS.getLong(options)) .setPageToken(PAGE_TOKEN.getString(options)) .setStartIndex(START_INDEX.getLong(options) != null ? BigInteger.valueOf(START_INDEX.getLong(options)) : null) .execute(); return Tuple.<String, Iterable<TableRow>>of(tableDataList.getPageToken(), tableDataList.getRows()); } catch (IOException ex) { throw translate(ex); } }
@Override public Tuple<String, Iterable<TableRow>> listTableData(String datasetId, String tableId, Map<Option, ?> options) { try { TableDataList tableDataList = bigquery.tabledata() .list(this.options.projectId(), datasetId, tableId) .setMaxResults(MAX_RESULTS.getLong(options)) .setPageToken(PAGE_TOKEN.getString(options)) .setStartIndex(START_INDEX.getLong(options) != null ? BigInteger.valueOf(START_INDEX.getLong(options)) : null) .execute(); return Tuple.<String, Iterable<TableRow>>of(tableDataList.getPageToken(), tableDataList.getRows()); } catch (IOException ex) { throw translate(ex); } }
private List<TableRow> getTableRows(Bigquery bq) { try { return bq.tabledata() .list( pipelineOptions.getProject(), pipelineOptions.getTargetDataset(), table.getTableReference().getTableId()) .execute() .getRows(); } catch (IOException e) { throw new RuntimeException(e); } }
private void onTableList(TableDataList result) throws IOException { when(mockClient.tabledata()).thenReturn(mockTabledata); when(mockTabledata.list(anyString(), anyString(), anyString())).thenReturn(mockTabledataList); when(mockTabledataList.execute()).thenReturn(result); }