Skip to content

0.1.3

Compare
Choose a tag to compare
@ajkannan ajkannan released this 27 Jan 02:34

Features

BigQuery

  • Resumable uploads via write channel are now supported (#540)

    An example of uploading a CSV file in chunks of CHUNK_SIZE bytes:

    try (FileChannel fileChannel = FileChannel.open(Paths.get("/path/to/your/file"))) {
      ByteBuffer buffer = ByteBuffer.allocate(256 * 1024);
      TableId tableId = TableId.of("YourDataset", "YourTable");
      LoadConfiguration configuration =
          LoadConfiguration.of(tableId, FormatOptions.of("CSV"));
      WriteChannel writeChannel = bigquery.writer(configuration);
      long position = 0;
      long written = fileChannel.transferTo(position, CHUNK_SIZE, writeChannel);
      while (written > 0) {
        position += written;
        written = fileChannel.transferTo(position, CHUNK_SIZE, writeChannel);
      }
      writeChannel.close();
    }
  • defaultDataset(String dataset) (in QueryJobInfo and QueryRequest) can be used to specify a default dataset (#567).

Storage

  • The name of the method to submit a batch request has changed from apply to submit (#562).

Fixes

BigQuery

  • hashCode and equals are now overridden in subclasses of BaseTableInfo (#565, #573).
  • jobComplete is renamed to jobCompleted in QueryResult (#567).

Datastore

  • The precondition check that cursors are UTF-8 strings has been removed (#578).

  • EntityQuery, KeyQuery, and ProjectionEntityQuery classes have been introduced (#585). This enables users to use modify projections and group by clauses for projection entity queries after using toBuilder(). For example, this now works:

    ProjectionEntityQuery query = Query.projectionEntityQueryBuilder()
        .kind("Person")
        .projection(Projection.property("name"))
        .build();
    ProjectionEntityQuery newQuery =
        query.toBuilder().projection(Projection.property("favorite_food")).build();