Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to write Range values with JSONStreamWriter #2498

Merged
merged 20 commits into from
May 31, 2024

Conversation

PhongChuong
Copy link
Contributor

@PhongChuong PhongChuong commented May 10, 2024

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2481 ☕️

@PhongChuong PhongChuong requested review from a team as code owners May 10, 2024 21:15
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. labels May 10, 2024
@PhongChuong
Copy link
Contributor Author

/gcbrun

1 similar comment
@PhongChuong
Copy link
Contributor Author

/gcbrun

Copy link
Contributor

@yirutang yirutang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some nits.

ServerStream<ReadRowsResponse> stream = client.readRowsCallable().call(readRowsRequest);
for (ReadRowsResponse response : stream) {
Preconditions.checkState(response.hasArrowRecordBatch());
rowCount += response.getRowCount();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate the value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added validation.


JSONObject row3 = new JSONObject();
JSONObject rangeDate3 = new JSONObject();
rangeDate3.put("start", 18262);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test date as a string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use string values.

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels May 30, 2024
@PhongChuong
Copy link
Contributor Author

/gcbrun

Copy link
Contributor Author

@PhongChuong PhongChuong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yirutang
Thanks for the review. I've updated the PR with the suggestions. PTAL.


JSONObject row3 = new JSONObject();
JSONObject rangeDate3 = new JSONObject();
rangeDate3.put("start", 18262);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use string values.

ServerStream<ReadRowsResponse> stream = client.readRowsCallable().call(readRowsRequest);
for (ReadRowsResponse response : stream) {
Preconditions.checkState(response.hasArrowRecordBatch());
rowCount += response.getRowCount();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added validation.

@PhongChuong
Copy link
Contributor Author

/gcbrun

@PhongChuong
Copy link
Contributor Author

/gcbrun

@PhongChuong PhongChuong merged commit a5e62be into main May 31, 2024
21 checks passed
@PhongChuong PhongChuong deleted the rangeJSONStreamWriter branch May 31, 2024 20:06
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. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Range types
2 participants