KEMBAR78
fix: Add a e2e test on byte string array and remove a impossible case… by yirutang · Pull Request #1546 · googleapis/java-bigquerystorage · GitHub
Skip to content

Conversation

@yirutang
Copy link
Contributor

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')

@yirutang yirutang requested review from a team and tswast February 21, 2022 18:28
@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Feb 21, 2022
@stephaniewang526 stephaniewang526 added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 24, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 24, 2022
@stephaniewang526 stephaniewang526 added the automerge Merge the pull request once unit tests and other checks pass. label Feb 24, 2022
@stephaniewang526 stephaniewang526 merged commit adcb9bb into googleapis:main Feb 24, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants