NICTA / scoobi

A Scala productivity framework for Hadoop.
http://nicta.github.com/scoobi/
482 stars 97 forks source link

Reduction companion object not accessible from Scoobi._ import #275

Closed blever closed 11 years ago

blever commented 11 years ago

If I only have the following import:

import com.nicta.scoobi.Scoobi._

I am unable to fully leverage the Reduction companion object. For example:

val r1 = Reduction((a, b) => a + b)  // doesn't compile
val r2 = Sum.int                     // does compile

It would be better if the Reduction companion object was brought into scope when importing the Scoobi object.

tonymorris commented 11 years ago

Agree. Will fix.

tonymorris commented 11 years ago

However, some of the names that come into scope may clash with other structures. They are very general. Are you sure you want them in scope?

blever commented 11 years ago

I think if you do import com.nicta.scoob.Scoobi._ it should just bring into scope a Reduction object, not everything inside it. That is, one would need to use Reduction.maximum rather than just maximum. This would avoid the clashes. If that's "too much typing", you can always explicitly import the object, e.g. import Reduction._, to bring everything in scope.

What do you think?

tonymorris commented 11 years ago

Yeah, this is OK. It would require some shuffling.