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-5729] added database/sql reader/writer #6676

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

adranwit
Copy link

@adranwit adranwit commented Oct 12, 2018

BEAM-5728 Adds database/sql reader/writer in go sdk

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

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@adranwit adranwit closed this Oct 12, 2018
@adranwit adranwit reopened this Oct 12, 2018
@adranwit adranwit closed this Oct 12, 2018
@adranwit
Copy link
Author

passed initial chec

@adranwit adranwit reopened this Oct 12, 2018
@adranwit adranwit closed this Oct 12, 2018
@adranwit adranwit reopened this Oct 12, 2018
@chamikaramj
Copy link
Contributor

R: @lostluck

@chamikaramj
Copy link
Contributor

Sorry about the delay. Adding Robert as a reviewer.

Any idea about the test failures ?

@lostluck
Copy link
Contributor

The RAT failures are because the license text needs to be at the top of every file.

The go failure appears to be this test: From the full jenkins output:
https://builds.apache.org/job/beam_PreCommit_Go_Commit/1107/consoleFull

06:06:40 === RUN Test_queryRecordMapperProvider
06:06:40 --- PASS: Test_queryRecordMapperProvider (0.00s)
06:06:40 === RUN Test_writerRecordMapperProvider
06:06:40 --- FAIL: Test_writerRecordMapperProvider (0.00s)
06:06:40 panic: runtime error: index out of range [recovered]
06:06:40 panic: runtime error: index out of range
06:06:40
06:06:40 goroutine 6 [running]:
06:06:40 testing.tRunner.func1(0xc4201d61e0)
06:06:40 /home/jenkins/.gradle/go/binary/1.10/go/src/testing/testing.go:742 +0x29d
06:06:40 panic(0x95a4c0, 0xdae210)
06:06:40 /home/jenkins/.gradle/go/binary/1.10/go/src/runtime/panic.go:505 +0x229
06:06:40 github.com/apache/beam/sdks/go/pkg/beam/io/databaseio.newWriterRowMapper.func1(0x9c49e0, 0xc4200aac40, 0x199, 0xc4200aac40, 0x16, 0x0, 0x0, 0x1)
06:06:40 /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Go_Commit/src/sdks/go/.gogradle/project_gopath/src/github.com/apache/beam/sdks/go/pkg/beam/io/databaseio/mapper.go:114 +0x23b
06:06:40 github.com/apache/beam/sdks/go/pkg/beam/io/databaseio.Test_writerRecordMapperProvider(0xc4201d61e0)
06:06:40 /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Go_Commit/src/sdks/go/.gogradle/project_gopath/src/github.com/apache/beam/sdks/go/pkg/beam/io/databaseio/util_test.go:75 +0x239
06:06:40 testing.tRunner(0xc4201d61e0, 0xa4d0a0)
06:06:40 /home/jenkins/.gradle/go/binary/1.10/go/src/testing/testing.go:777 +0xd0
06:06:40 created by testing.(*T).Run
06:06:40 /home/jenkins/.gradle/go/binary/1.10/go/src/testing/testing.go:824 +0x2e0
06:06:40 FAIL github.com/apache/beam/sdks/go/pkg/beam/io/databaseio 0.011s
06:06:40
06:06:40 > Task :beam-sdks-go:test
06:06:40 Test for github.com/apache/beam/sdks/go/pkg/beam/io/databaseio finished, 2 completed, 1 failed

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

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

I love how complete this CL is. Once we get the tests passing, we should get this in.

There are opportunities to reduce overhead, either in connections to the DB or in reducing work done per element, but that can be done later as needed.

I tried to figure out what's going wrong with the test, but nothing is jumping out at me, it appears the mapping should work as expected. I assume that the test passes locally for you.

sdks/go/pkg/beam/io/databaseio/database.go Show resolved Hide resolved
sdks/go/pkg/beam/io/databaseio/mapper.go Show resolved Hide resolved
sdks/go/pkg/beam/io/databaseio/mapper.go Outdated Show resolved Hide resolved
sdks/go/pkg/beam/io/databaseio/writer.go Outdated Show resolved Hide resolved
sdks/go/pkg/beam/io/databaseio/database.go Show resolved Hide resolved
@lostluck
Copy link
Contributor

Consider editing the title of this PR to be prefixed with [BEAM-5729] so it gets linked to the Jira you filed before. https://issues.apache.org/jira/browse/BEAM-5729

Consider also requesting contributor status to the Beam jira, so we can correctly assign the JIRA to you. Afterall, you did all this work!

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

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

Thanks for your patience. I have a few small comments, but otherwise LGTM.

sdks/go/pkg/beam/io/databaseio/database.go Outdated Show resolved Hide resolved
sdks/go/pkg/beam/io/databaseio/database.go Outdated Show resolved Hide resolved
@lostluck
Copy link
Contributor

lostluck commented Nov 13, 2018

Thanks again!
@chamikaramj Please merge.

Edit: Though you could prefix the github PR title with [BEAM-5729], that would be ideal.
[BEAM-5729] added database/sql reader/writer

@chamikaramj
Copy link
Contributor

Thanks. @adranwit could you fix up to a single (or few) commits(s) for merging ?

@adranwit adranwit changed the title added database/sql reader/writer [BEAM-5729] added database/sql reader/writer Nov 13, 2018
@adranwit
Copy link
Author

@chamikaramj not sure what the ask is "could you fix up to a single (or few) commit (s)", what exactly needs to be fixed ?

@chamikaramj
Copy link
Contributor

Sorry, could you fix up your commits (currently 11) to one or few commits that you would like to appear in Beam commit history as per https://beam.apache.org/contribute/committer-guide/.

@adranwit
Copy link
Author

@chamikaramj not sure if you can remove existing comments, all that said I have added the extra one summarizing the changes: [BEAM-5729] added database/sql based reader and writer

@chamikaramj
Copy link
Contributor

You can use "git rebase" to fixup commits. See https://help.github.com/articles/about-git-rebase/.

@chamikaramj
Copy link
Contributor

chamikaramj commented Nov 14, 2018

Looks like commit history got messed up somehow ?

Usually I perform following to fixup all my commits.

(1) git rebase -i HEAD~<number of my commits>
(2) add 'f' in front of everything but the first commit for fixing up.
(3) git commit --amend (to update the commit if needed)
(3) git push -f <my github fork>

@@ -38,6 +38,14 @@ def test_assert_that_passes(self):
with TestPipeline() as p:
assert_that(p | Create([1, 2, 3]), equal_to([1, 2, 3]))

def test_assert_that_passes_order_does_not_matter(self):
with TestPipeline() as p:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes (to util_test.py) intended ? Looks like a merge issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Everything else looks good. Thanks.

Copy link
Author

Choose a reason for hiding this comment

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

not sure how to get that removed

@chamikaramj chamikaramj merged commit 285923a into apache:master Nov 15, 2018
@chamikaramj
Copy link
Contributor

Thanks. Merged.

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