Skip to content

Commit

Permalink
feat: add ability to request compressed ReadRowsResponse rows (#6955)
Browse files Browse the repository at this point in the history
This change allows the client to request raw lz4 compression of the ReadRowsResponse rows data for both ArrowRecordBatches and Avro rows.
PiperOrigin-RevId: 597000088
Source-Link: googleapis/googleapis@341d70f
Source-Link: googleapis/googleapis-gen@01713f3
Copy-Tag: eyJwIjoiQmlnUXVlcnlTdG9yYWdlLy5Pd2xCb3QueWFtbCIsImgiOiIwMTcxM2YzZjU1MzRhY2M3OGYwNGQ1OWUxM2MwNjY4YzgxMjliZjAzIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Jan 12, 2024
1 parent 53c8a0d commit 8ec090e
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 0 deletions.
Binary file modified BigQueryStorage/metadata/V1/Storage.php
Binary file not shown.
Binary file modified BigQueryStorage/metadata/V1/Stream.php
Binary file not shown.
96 changes: 96 additions & 0 deletions BigQueryStorage/src/V1/ReadRowsResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions BigQueryStorage/src/V1/ReadSession/TableReadOptions.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions BigQueryStorage/tests/Unit/V1/BigQueryReadClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,22 @@ public function readRowsTest()
$this->assertTrue($transport->isExhausted());
// Mock response
$rowCount = 1340416618;
$uncompressedByteSize = 2094376525;
$expectedResponse = new ReadRowsResponse();
$expectedResponse->setRowCount($rowCount);
$expectedResponse->setUncompressedByteSize($uncompressedByteSize);
$transport->addResponse($expectedResponse);
$rowCount2 = 349815907;
$uncompressedByteSize2 = 1643824294;
$expectedResponse2 = new ReadRowsResponse();
$expectedResponse2->setRowCount($rowCount2);
$expectedResponse2->setUncompressedByteSize($uncompressedByteSize2);
$transport->addResponse($expectedResponse2);
$rowCount3 = 349815906;
$uncompressedByteSize3 = 1643824295;
$expectedResponse3 = new ReadRowsResponse();
$expectedResponse3->setRowCount($rowCount3);
$expectedResponse3->setUncompressedByteSize($uncompressedByteSize3);
$transport->addResponse($expectedResponse3);
// Mock request
$formattedReadStream = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,22 @@ public function readRowsTest()
$this->assertTrue($transport->isExhausted());
// Mock response
$rowCount = 1340416618;
$uncompressedByteSize = 2094376525;
$expectedResponse = new ReadRowsResponse();
$expectedResponse->setRowCount($rowCount);
$expectedResponse->setUncompressedByteSize($uncompressedByteSize);
$transport->addResponse($expectedResponse);
$rowCount2 = 349815907;
$uncompressedByteSize2 = 1643824294;
$expectedResponse2 = new ReadRowsResponse();
$expectedResponse2->setRowCount($rowCount2);
$expectedResponse2->setUncompressedByteSize($uncompressedByteSize2);
$transport->addResponse($expectedResponse2);
$rowCount3 = 349815906;
$uncompressedByteSize3 = 1643824295;
$expectedResponse3 = new ReadRowsResponse();
$expectedResponse3->setRowCount($rowCount3);
$expectedResponse3->setUncompressedByteSize($uncompressedByteSize3);
$transport->addResponse($expectedResponse3);
// Mock request
$formattedReadStream = $gapicClient->readStreamName('[PROJECT]', '[LOCATION]', '[SESSION]', '[STREAM]');
Expand Down

0 comments on commit 8ec090e

Please sign in to comment.