Scoobi document error for groupingc ?

15 views
Skip to first unread message

Jeff Zhang

unread,
Feb 5, 2013, 2:08:46 AM2/5/13
to scoobi...@googlegroups.com
Hi ,

I found in the document of Scoobi in the grouping section, it tell me that I should override method sortCompare as following, but as my understanding, I should override groupCompare rather than sortCompare, right ?

implicit val pointGrouping = new Grouping[Point] {
 
override def sortCompare(first: Point, second: Point) {
    val xResult
= first.x.compareTo(second.x)
   
if (xResult != 0)
      xResult
   
else {
      val yResult
= first.y.compareTo(second.y)
     
if (yResult != 0) yResult
     
else              0
   
}
 
}
}


Eric Springer

unread,
Feb 5, 2013, 8:39:53 AM2/5/13
to scoobi...@googlegroups.com
Yeah, the docs should be changed. For simple grouping needs, you
should only define groupCompare (and sortCompare defaults to
groupCompare). For more advanced needs (secondary sorting), you should
define both.

But actually, if you only have simple needs, I think it makes more
sense to just define Ordering of your type, and let scoobi derive the
grouping from that
> --
> You received this message because you are subscribed to the Google Groups
> "scoobi-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scoobi-users...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Eric Torreborre

unread,
Feb 5, 2013, 5:03:49 PM2/5/13
to scoobi...@googlegroups.com
I updated the docs for the next 0.7.0 version.
Reply all
Reply to author
Forward
0 new messages