Skip to content

[BEAM-1071] Allow for streaming tables with CREATE_NEVER disposition#1590

Closed
sammcveety wants to merge 3 commits intoapache:masterfrom
sammcveety:sgmc/never_disposition
Closed

[BEAM-1071] Allow for streaming tables with CREATE_NEVER disposition#1590
sammcveety wants to merge 3 commits intoapache:masterfrom
sammcveety:sgmc/never_disposition

Conversation

@sammcveety
Copy link
Copy Markdown
Contributor

@sammcveety sammcveety commented Dec 13, 2016

R: @dhalperi

This turned out a bit more involved than I'd hoped.

@asfbot
Copy link
Copy Markdown

asfbot commented Dec 13, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/5809/

Build result: FAILURE

[...truncated 6618 lines...]No artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: Runners :: Apex #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/io/jms/pom.xml to org.apache.beam/beam-sdks-java-io-jms/0.4.0-incubating-SNAPSHOT/beam-sdks-java-io-jms-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: IO :: JMS #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/runners/flink/pom.xml to org.apache.beam/beam-runners-flink-parent/0.4.0-incubating-SNAPSHOT/beam-runners-flink-parent-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: Runners :: Flink #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/io/mongodb/pom.xml to org.apache.beam/beam-sdks-java-io-mongodb/0.4.0-incubating-SNAPSHOT/beam-sdks-java-io-mongodb-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: IO :: MongoDB #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/extensions/sorter/pom.xml to org.apache.beam/beam-sdks-java-extensions-sorter/0.4.0-incubating-SNAPSHOT/beam-sdks-java-extensions-sorter-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: Extensions :: Sorter #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/pom.xml to org.apache.beam/beam-sdks-parent/0.4.0-incubating-SNAPSHOT/beam-sdks-parent-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/extensions/join-library/pom.xml to org.apache.beam/beam-sdks-java-extensions-join-library/0.4.0-incubating-SNAPSHOT/beam-sdks-java-extensions-join-library-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: Extensions :: Join library #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/runners/pom.xml to org.apache.beam/beam-runners-parent/0.4.0-incubating-SNAPSHOT/beam-runners-parent-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: Runners #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/io/jdbc/pom.xml to org.apache.beam/beam-sdks-java-io-jdbc/0.4.0-incubating-SNAPSHOT/beam-sdks-java-io-jdbc-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: IO :: JDBC #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/sdks/java/extensions/pom.xml to org.apache.beam/beam-sdks-java-extensions-parent/0.4.0-incubating-SNAPSHOT/beam-sdks-java-extensions-parent-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: SDKs :: Java :: Extensions #5808 to compare, so performing full copy of artifacts[JENKINS] Archiving /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Java_MavenInstall/examples/pom.xml to org.apache.beam/beam-examples-parent/0.4.0-incubating-SNAPSHOT/beam-examples-parent-0.4.0-incubating-SNAPSHOT.pomNo artifacts from beam_PreCommit_Java_MavenInstall » Apache Beam :: Examples #5808 to compare, so performing full copy of artifactschannel stoppedSetting status of 7624040 to FAILURE with url https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/5809/ and message: 'Build finished. 'Using context: Jenkins: Maven clean install
--none--

@sammcveety
Copy link
Copy Markdown
Contributor Author

retest this please

@sammcveety
Copy link
Copy Markdown
Contributor Author

Failure appears unrelated:

2016-12-13T13:55:36.768 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:jar (default-jar) on project beam-sdks-java-maven-archetypes-starter: Execution default-jar of goal org.apache.maven.plugins:maven-archetype-plugin:2.4:jar failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:2.4 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-archetype-plugin:jar:2.4 -> org.apache.maven.shared:maven-invoker:jar:2.2: Failed to read artifact descriptor for org.apache.maven.shared:maven-invoker:jar:2.2: Could not transfer artifact org.apache.maven.shared:maven-invoker:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): Access denied to: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-invoker/2.2/maven-invoker-2.2.pom , ReasonPhrase:Forbidden. -> [Help 1]

@asfbot
Copy link
Copy Markdown

asfbot commented Dec 13, 2016

@sammcveety
Copy link
Copy Markdown
Contributor Author

retest this please

@asfbot
Copy link
Copy Markdown

asfbot commented Dec 13, 2016

@asfbot
Copy link
Copy Markdown

asfbot commented Dec 13, 2016

Copy link
Copy Markdown
Contributor

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

Not sure this is really catching new error cases well. I added a few suggestive comments of various constructions I think might slip through validation now.

throws IOException {
TableReference tableReference = parseTableSpec(tableSpec);
if (!createdTables.contains(tableSpec)) {
if (!createdTables.contains(tableSpec) && jsonTableSchema != null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of using jsonTableSchema != null can we check CreateDisposition == NEVER?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd need to pass the parameter through and store, we're good with that?

createDisposition != CreateDisposition.CREATE_NEVER,
"CreateDisposition.CREATE_NEVER is not supported when using a tablespec"
+ " function.");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we check the dual of this where it is appropriate? : If the schema is null, then CreateDisposition == CreateNEVER

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will break when combined with my PR. What's the rationale for this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The rationale is to be able to run a streaming pipeline against an already-created table without needing to specify the schema. Very useful for some templates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds like Reuven is now ok with this change. looking

@asfbot
Copy link
Copy Markdown

asfbot commented Dec 17, 2016

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6056/
--none--

@sammcveety
Copy link
Copy Markdown
Contributor Author

Added some more testing and addressed comments, please take another look.

@reuvenlax
Copy link
Copy Markdown
Contributor

You're going to have to merge with the current version of the code

@sammcveety
Copy link
Copy Markdown
Contributor Author

@reuvenlax could you be more specific? Github says there are no merge conflicts, and all tests pass.

TableReference tableRef = new TableReference();
tableRef.setDatasetId("dataset");
tableRef.setTableId("sometable");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Create.<TableRow>of()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This creates a bounded collection, which fails the UNBOUNDED conditionals. This raises a few possibilities:

  • Should CreateUnbounded be a shorthand we have?
  • Should these conditionals check options.isStreaming() (guessing not, because that's less clean with respect to the model)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, I was just wrong. You were right.

@reuvenlax
Copy link
Copy Markdown
Contributor

@sammcveety that's because your branch doesn't include latest changes in this file - specifically the testing ones. You will have to fetch changes and rebase to origin/master to sync - then you'll have to resolve conflicts. In addition to conflicts, getOrCreateTable will have to be fixed, as it no longer supports create_never.

@sammcveety
Copy link
Copy Markdown
Contributor Author

retest this please

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/beam_PreCommit_Java_MavenInstall/6486/
--none--

@sammcveety
Copy link
Copy Markdown
Contributor Author

@reuvenlax I retested this and it is running against head. I believe it to be ready for another review by @dhalperi .

Copy link
Copy Markdown
Contributor

@dhalperi dhalperi left a comment

Choose a reason for hiding this comment

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

LGTM.

I can make the minor fix in merging .

TableReference tableReference = parseTableSpec(tableSpec);
if (!createdTables.contains(tableSpec)) {
if (!createdTables.contains(tableSpec)
&& createDisposition != createDisposition.CREATE_NEVER) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

swap check order? createdTables is a concurrent data structure.

@asfgit asfgit closed this in f2389ab Jan 24, 2017
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.

4 participants