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

Extend TextLine with TypedSink #1752

Merged
merged 5 commits into from
Nov 2, 2017

Conversation

snoble
Copy link
Contributor

@snoble snoble commented Oct 31, 2017

@johnynek
Copy link
Collaborator

can we add a test to https://github.com/twitter/scalding/blob/develop/scalding-core/src/test/scala/com/twitter/scalding/TypedPipeTest.scala. We should use .runHadoop I think to test it out.

@snoble
Copy link
Contributor Author

snoble commented Oct 31, 2017

@johnynek test added

// For some Java interop
implicit val tset: TupleSetter[String]
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this need to be implicit? And can it be private[this] val...

@@ -523,9 +523,13 @@ object TextLine {
new TextLine(p, sm, textEncoding)
}

class TextLine(p: String, override val sinkMode: SinkMode, override val textEncoding: String) extends FixedPathSource(p) with TextLineScheme {
class TextLine(p: String, override val sinkMode: SinkMode, override val textEncoding: String)(
implicit val tset: TupleSetter[String]
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove this and instead do:
override def setter[U <: String] = TupleSetter.asSubSetter[String, U](TupleSetter.of[String]) taking the implicit in the constructor changes the binary compatibility without a need that I see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh cool! kk

@snoble
Copy link
Contributor Author

snoble commented Nov 1, 2017

I'll figure out why this test is failing tomorrow

@johnynek johnynek merged commit e46d410 into twitter:develop Nov 2, 2017
@johnynek
Copy link
Collaborator

johnynek commented Nov 2, 2017

Nice work @snoble ! Thanks for fixing this broken window!

johnynek pushed a commit that referenced this pull request Dec 19, 2017
* Extend TextLine with TypedSink

* Add test for TextLine

* Remove need for implicit

* Add run so scalding-core tests pass

* TextLine requires an offset. Need a separate test name for run and
runhadoop
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.

3 participants