Skip to content

Commit

Permalink
feat: add ability to request compressed ReadRowsResponse rows
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: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDE3MTNmM2Y1NTM0YWNjNzhmMDRkNTllMTNjMDY2OGM4MTI5YmYwMyJ9
  • Loading branch information
gcf-owl-bot[bot] committed Jan 9, 2024
1 parent d073089 commit d887f48
Show file tree
Hide file tree
Showing 78 changed files with 89,834 additions and 0 deletions.
7 changes: 7 additions & 0 deletions owl-bot-staging/v1/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules
**/.coverage
build/
docs/
protos/
system-test/
samples/generated/
3 changes: 3 additions & 0 deletions owl-bot-staging/v1/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
14 changes: 14 additions & 0 deletions owl-bot-staging/v1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**/*.log
**/node_modules
/.coverage
/coverage
/.nyc_output
/docs/
/out/
/build/
system-test/secrets.js
system-test/*key.json
*.lock
.DS_Store
package-lock.json
__pycache__
55 changes: 55 additions & 0 deletions owl-bot-staging/v1/.jsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

module.exports = {
opts: {
readme: './README.md',
package: './package.json',
template: './node_modules/jsdoc-fresh',
recurse: true,
verbose: true,
destination: './docs/'
},
plugins: [
'plugins/markdown',
'jsdoc-region-tag'
],
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'build/src',
'protos'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2024 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/bigquery-storage',
theme: 'lumen',
default: {
outputSourceFiles: false
}
},
markdown: {
idInHeadings: true
}
};
33 changes: 33 additions & 0 deletions owl-bot-staging/v1/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

const config = {
"enable-source-maps": true,
"throw-deprecation": true,
"timeout": 10000
}
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
delete config['throw-deprecation'];
}
if (process.env.MOCHA_REPORTER) {
config.reporter = process.env.MOCHA_REPORTER;
}
if (process.env.MOCHA_REPORTER_OUTPUT) {
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`;
}
module.exports = config
22 changes: 22 additions & 0 deletions owl-bot-staging/v1/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **


module.exports = {
...require('gts/.prettierrc.json')
}
1 change: 1 addition & 0 deletions owl-bot-staging/v1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Storage: Nodejs Client
59 changes: 59 additions & 0 deletions owl-bot-staging/v1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "@google-cloud/bigquery-storage",
"version": "0.1.0",
"description": "Storage client for Node.js",
"repository": "googleapis/nodejs-storage",
"license": "Apache-2.0",
"author": "Google LLC",
"main": "build/src/index.js",
"files": [
"build/src",
"build/protos"
],
"keywords": [
"google apis client",
"google api client",
"google apis",
"google api",
"google",
"google cloud platform",
"google cloud",
"cloud",
"google storage",
"storage",
"big query read",
"big query write"
],
"scripts": {
"clean": "gts clean",
"compile": "tsc -p . && cp -r protos build/ && minifyProtoJson",
"compile-protos": "compileProtos src",
"docs": "jsdoc -c .jsdoc.js",
"fix": "gts fix",
"lint": "gts check",
"prepare": "npm run compile-protos && npm run compile",
"system-test": "c8 mocha build/system-test",
"test": "c8 mocha build/test"
},
"dependencies": {
"google-gax": "^4.0.5"
},
"devDependencies": {
"@types/mocha": "^10.0.2",
"@types/node": "^18.11.18",
"@types/sinon": "^10.0.19",
"c8": "^8.0.1",
"gapic-tools": "^0.2.0",
"gts": "5.2.0",
"jsdoc": "^4.0.2",
"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^3.0.0",
"mocha": "^10.2.0",
"pack-n-play": "^2.0.3",
"sinon": "^15.2.0",
"typescript": "5.1.6"
},
"engines": {
"node": ">=v14"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";

package google.cloud.bigquery.storage.v1;

import "google/protobuf/descriptor.proto";

option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1";
option go_package = "cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepb";
option java_package = "com.google.cloud.bigquery.storage.v1";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

extend google.protobuf.FieldOptions {
// Setting the column_name extension allows users to reference
// bigquery column independently of the field name in the protocol buffer
// message.
//
// The intended use of this annotation is to reference a destination column
// named using characters unavailable for protobuf field names (e.g. unicode
// characters).
//
// More details about BigQuery naming limitations can be found here:
// https://cloud.google.com/bigquery/docs/schemas#column_names
//
// This extension is currently experimental.
optional string column_name = 454943157;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.bigquery.storage.v1;

option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1";
option go_package = "cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepb";
option java_multiple_files = true;
option java_outer_classname = "ArrowProto";
option java_package = "com.google.cloud.bigquery.storage.v1";
option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

// Arrow schema as specified in
// https://arrow.apache.org/docs/python/api/datatypes.html
// and serialized to bytes using IPC:
// https://arrow.apache.org/docs/format/Columnar.html#serialization-and-interprocess-communication-ipc
//
// See code samples on how this message can be deserialized.
message ArrowSchema {
// IPC serialized Arrow schema.
bytes serialized_schema = 1;
}

// Arrow RecordBatch.
message ArrowRecordBatch {
// IPC-serialized Arrow RecordBatch.
bytes serialized_record_batch = 1;

// [Deprecated] The count of rows in `serialized_record_batch`.
// Please use the format-independent ReadRowsResponse.row_count instead.
int64 row_count = 2 [deprecated = true];
}

// Contains options specific to Arrow Serialization.
message ArrowSerializationOptions {
// Compression codec's supported by Arrow.
enum CompressionCodec {
// If unspecified no compression will be used.
COMPRESSION_UNSPECIFIED = 0;

// LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md)
LZ4_FRAME = 1;

// Zstandard compression.
ZSTD = 2;
}

// The compression codec to use for Arrow buffers in serialized record
// batches.
CompressionCodec buffer_compression = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.bigquery.storage.v1;

option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1";
option go_package = "cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepb";
option java_multiple_files = true;
option java_outer_classname = "AvroProto";
option java_package = "com.google.cloud.bigquery.storage.v1";
option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

// Avro schema.
message AvroSchema {
// Json serialized schema, as described at
// https://avro.apache.org/docs/1.8.1/spec.html.
string schema = 1;
}

// Avro rows.
message AvroRows {
// Binary serialized rows in a block.
bytes serialized_binary_rows = 1;

// [Deprecated] The count of rows in the returning block.
// Please use the format-independent ReadRowsResponse.row_count instead.
int64 row_count = 2 [deprecated = true];
}

// Contains options specific to Avro Serialization.
message AvroSerializationOptions {
// Enable displayName attribute in Avro schema.
//
// The Avro specification requires field names to be alphanumeric. By
// default, in cases when column names do not conform to these requirements
// (e.g. non-ascii unicode codepoints) and Avro is requested as an output
// format, the CreateReadSession call will fail.
//
// Setting this field to true, populates avro field names with a placeholder
// value and populates a "displayName" attribute for every avro field with the
// original column name.
bool enable_display_name_attribute = 1;
}
Loading

0 comments on commit d887f48

Please sign in to comment.