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

companion object & extra schema #3

Open
xhudik opened this issue Mar 14, 2015 · 1 comment
Open

companion object & extra schema #3

xhudik opened this issue Mar 14, 2015 · 1 comment

Comments

@xhudik
Copy link

xhudik commented Mar 14, 2015

Hi, 2 newbies questions:

  1. why did you use companion object for each EvalFunc[Tuple] in your files? I mean why those functions in companion objects are not defined within the class extending EvalFunc? Is there some performance adavantage?
  2. outputSchema: (e.g. here https://github.com/bearrito/scala-pig/blob/master/src/main/scala/barrett/udf/SimpleWeatherParser.scala). There is defined a new schema: val tuple = new Schema(), everything is set up and then at the end another schema (s) is created and returned. Why this extra s schema had to be defined?

thanks!

@bearrito
Copy link
Owner

I wanted to be able to test those methods without creating an instance of the parser. If I had to do it over I would have put them in a trait that is probably more scala idiomatic.

The extra tuple is just a bug. I believe I had an error and was doing some debugging and pulled apart the tuple to make it easier to see what was happening.

All of this code was created for a demo, so it isn't necessarily the cleanest.

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

2 participants