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

doc: Array of Structure Query Code sample #2540

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

farhan0102
Copy link
Contributor

@farhan0102 farhan0102 commented Feb 24, 2023

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 #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/java-bigquery API. samples Issues that are directly related to samples. labels Feb 24, 2023
@farhan0102 farhan0102 changed the title Array of Structure Query Code sample featArray of Structure Query Code sample Feb 24, 2023
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Feb 24, 2023

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@farhan0102 farhan0102 changed the title featArray of Structure Query Code sample feat: Array of Structure Query Code sample Feb 24, 2023
@farhan0102 farhan0102 force-pushed the QueryWithArrayOfStructSample branch 4 times, most recently from 5ce6a03 to 9bf94f5 Compare February 24, 2023 18:12
@farhan0102 farhan0102 marked this pull request as ready for review February 24, 2023 18:18
@snippet-bot
Copy link

snippet-bot bot commented Feb 24, 2023

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@farhan0102 farhan0102 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 24, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 24, 2023
@farhan0102 farhan0102 assigned Neenu1995 and unassigned Neenu1995 Feb 28, 2023
@Neenu1995 Neenu1995 added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 1, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 1, 2023
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner March 1, 2023 19:19
@gcf-owl-bot gcf-owl-bot bot requested a review from a team March 1, 2023 19:19
TableResult results = bigquery.query(queryConfig);
results
.iterateAll()
.forEach(row -> row.forEach(val -> System.out.printf("%s", val.toString())));
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if this is printing the expected 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.

did you want me to add it as a part of the unit test?

currently it prints:

[INFO] Running com.example.bigquery.QueryWithArrayOfStructsNamedParametersIT
Mar 01, 2023 11:45:03 PM com.example.bigquery.QueryWithArrayOfStructsNamedParametersIT tearDown
INFO: 
FieldValue{attribute=REPEATED, value=[FieldValue{attribute=PRIMITIVE, value=QueryParameterValue{value=null, arrayValuesInner=null, structValuesInner={stringField=QueryParameterValue{value=test-stringField, arrayValuesInner=null, structValuesInner=null, type=STRING, arrayType=null, structTypesInner=null}}, type=STRUCT, arrayType=null, structTypesInner={stringField=QueryParameterValue{value=test-stringField, arrayValuesInner=null, structValuesInner=null, type=STRING, arrayType=null, structTypesInner=null}}}}]}Query with Array of struct parameters performed successfully.

[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.319 s - in com.example.bigquery.QueryWithArrayOfStructsNamedParametersIT

Copy link
Contributor

Choose a reason for hiding this comment

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

This is good. LGTM

@@ -0,0 +1,68 @@
/*
* Copyright 2020 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

Update License Year

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,58 @@
/*
* Copyright 2020 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

Update license year

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@farhan0102 farhan0102 force-pushed the QueryWithArrayOfStructSample branch from b25fc76 to 3116b76 Compare March 1, 2023 23:33
@Neenu1995
Copy link
Contributor

nit: The conventional commit for samples is doc. feat will add it as a feature to the release notes.

@Neenu1995 Neenu1995 changed the title feat: Array of Structure Query Code sample doc: Array of Structure Query Code sample Mar 2, 2023
@Neenu1995 Neenu1995 merged commit 2c09c87 into main Mar 2, 2023
@Neenu1995 Neenu1995 deleted the QueryWithArrayOfStructSample branch March 2, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. samples Issues that are directly related to samples. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants