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

[BEAM-2817] BigQuery queries are allowed to run in either BATCH or IN… #4606

Merged
merged 1 commit into from Feb 9, 2018

Conversation

justintumale
Copy link

…TERACTIVE mode

DESCRIPTION HERE


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand:
    • What the pull request does
    • Why it does it
    • How it does it
    • Why this approach
  • Each commit in the pull request should have a meaningful subject line and body.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@justintumale
Copy link
Author

Closed the previous pull request and opened this one. Thanks
@chamikaramj @jkff

@chamikaramj
Copy link
Contributor

LGTM

Thanks for the contribution.

For reference, previous review is in #4226.

@chamikaramj
Copy link
Contributor

Run Java PreCommit

@chamikaramj
Copy link
Contributor

Please fix the Javadoc errors.

2018-02-06T20:26:53.975 [ERROR] Exit code: 1 - /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall@2/src/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:915: error: reference not found
2018-02-06T20:26:53.975 [ERROR] /** See {@link Read#usingInteractivePriority()}. /
2018-02-06T20:26:53.975 [ERROR] ^
2018-02-06T20:26:53.975 [ERROR] /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall@2/src/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:920: error: reference not found
2018-02-06T20:26:53.975 [ERROR] /
* See {@link Read#usingInteractivePriority()}. */
2018-02-06T20:26:53.975 [ERROR] ^

https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/17572/console

@justintumale
Copy link
Author

Sure, thanks

@chamikaramj
Copy link
Contributor

Please let me know when it's ready.

@justintumale
Copy link
Author

justintumale commented Feb 8, 2018

Will do, I'll get to it tonight after work. Do I run Java Precommit to test it out? @chamikaramj

@chamikaramj
Copy link
Contributor

Java PreCommit will automatically run when you push your update. Also, please merge your commits into a single commit.

…TERACTIVE mode

[BEAM-2817] fixed javadoc errors

[BEAM-2817] fixed javadoc errors
@justintumale
Copy link
Author

This is ready @chamikaramj

@chamikaramj
Copy link
Contributor

Thanks. Merging.

@chamikaramj chamikaramj merged commit bd11416 into apache:master Feb 9, 2018
@justintumale justintumale deleted the feature branch March 10, 2018 18:43

PAssert.that(output)
.containsInAnyOrder(ImmutableList.of(KV.of("a", 1L), KV.of("b", 2L), KV.of("c", 3L)));
assertEquals(read.getPriority(), BigQueryIO.TypedRead.Priority.INTERACTIVE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately this doesn't actually do anything, and the tests are vacuous (pass without verifying what they are supposed to verify).

read.getPriority() simply returns what you set on .usingInteractivePriority() - you need to be verifying the priority that was used on the actual BigQuery load job.

super(stepUuid, bqServices, coder, parseFn);
this.query = checkNotNull(query, "query");
this.flattenResults = checkNotNull(flattenResults, "flattenResults");
this.useLegacySql = checkNotNull(useLegacySql, "useLegacySql");
this.dryRunJobStats = new AtomicReference<>();
if (priority != BigQueryIO.TypedRead.Priority.BATCH
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is always true - "priority != a || priority != b" is true by definition, because it can't equal a and b at the same time. I suppose you probably meant "&&", but then again I'm not sure why this condition is needed at all - why not just "this.priority = priority"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a need to rollback before the release ? Looks like this just keeps the previous default, right ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fixing this in my PR. Probably not too big of a deal, just this feature won't really be usable in the release, but will be in the next one. No regression.

Copy link
Author

Choose a reason for hiding this comment

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

Good find. This should be && as this sets the Priority to default. This was done in the case that an incorrect priority is passed in that is neither batch or interactive. Please let me know the next steps as I see that you will fix this part of the PR. I can fix the unit tests if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants