This repository was archived by the owner on Feb 24, 2026. It is now read-only.
fix: Add a e2e test on byte string array and remove a impossible case…#1546
Merged
stephaniewang526 merged 1 commit intogoogleapis:mainfrom Feb 24, 2022
yirutang:bytestring
Merged
fix: Add a e2e test on byte string array and remove a impossible case…#1546stephaniewang526 merged 1 commit intogoogleapis:mainfrom yirutang:bytestring
stephaniewang526 merged 1 commit intogoogleapis:mainfrom
yirutang:bytestring
Conversation
… for byte array conversion
stephaniewang526
approved these changes
Feb 24, 2022
stephaniewang526
approved these changes
Feb 24, 2022
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Feb 28, 2022
🤖 I have created a release *beep* *boop* --- ## [2.10.0](v2.9.1...v2.10.0) (2022-02-28) ### Features * add trace_id for Read API ([#1544](#1544)) ([5a92ade](5a92ade)) ### Bug Fixes * Add a e2e test on byte string array and remove a impossible case for byte array conversion ([#1546](#1546)) ([adcb9bb](adcb9bb)) * add more idiomatic way to insert ARRAY<BYTES> data ([#1550](#1550)) ([3ae4038](3ae4038)) * remove bigquery.readonly auth scope ([#1543](#1543)) ([a70ae45](a70ae45)) ### Dependencies * update actions/github-script action to v6 ([#1533](#1533)) ([370c3b5](370c3b5)) * update dependency com.google.cloud:google-cloud-bigquery to v2.9.0 ([#1538](#1538)) ([43446b2](43446b2)) ### Documentation * **tutorials:** Add STRUCT column to tutorial ([#1534](#1534)) ([9595dab](9595dab)) * **tutorials:** Call append asynchronously instead of blocking ([#1542](#1542)) ([c777e23](c777e23)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per internal bug b/219375453, it seems JSON object doesn't support cast of ByteString, so remove the ByteString case in repeated field conversion since it is not possible.
JSONArray jsonArray = new JSONArray(new ByteString[]{ByteString.copyFromUtf8("a"), ByteString.copyFromUtf8("b")}); LOG.info("" + (jsonArray.get(0) instanceof ByteString));
LOG.info("" + ((ByteString)jsonArray.get(0)).toByteArray());
INFO: *****false
java.lang.ClassCastException: class org.json.JSONObject cannot be cast to class com.google.protobuf.ByteString (org.json.JSONObject and com.google.protobuf.ByteString are in unnamed module of loader 'app')