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

TypedDelimited is confusing: needs both sinkFields and fields overrides #1029

Closed
johnynek opened this issue Aug 28, 2014 · 6 comments
Closed

Comments

@johnynek
Copy link
Collaborator

If you forget to override sinkFields, you get a cryptic error if you use it to write.

Solution: there should be a final override def sinkFields = fields in TypedDelimited, probably.

@reconditesea
Copy link
Contributor

Sounds good.
One small comment. Looks like sinkFields is only needed for TypedSink. Traits like DelimitedSchema don't need it and can still be used as Sink. For the purpose of reduce confusion, does it make sense to rename it to typedSinkFields?

@ianoc
Copy link
Collaborator

ianoc commented Aug 29, 2014

renaming fields is a big pain for compatibility, so -1 on that. Also not sure we want to call that out, ideally most sources are setup to be used as typed sources/sink's.

@reconditesea
Copy link
Contributor

Good point. But in this sense, making sinkFields a final is not back-compatible either? It's overridden in all user classes that extends TypedSInk.

@ianoc
Copy link
Collaborator

ianoc commented Aug 29, 2014

Its localized to TypeDelimited where i guess the inference of this ticket is that people shouldn't be changing it?

@reconditesea
Copy link
Contributor

How to reproduce the issue described in the ticket? Extending TypeDelimited trait but forget to override sinkFields? Or extend TypeDelimited and override sinkFields to something wrong?

Are we sure there is no case where people extend TypeDelimited and override sinkFields in their own code? If yes, this sounds great and should be a very straightforward change.

@reconditesea
Copy link
Contributor

If we believe no user code is overriding sinkFileds when extending TypedDelimited, I think the change here is really simple as in #1032.

@johnynek johnynek closed this as completed Sep 5, 2014
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

No branches or pull requests

3 participants