GravityLabs / HPaste

HBase DSL for Scala with MapReduce support
http://www.gravity.com/technology/
Apache License 2.0
127 stars 32 forks source link

Change that will skip call to addColumn() if column was already included from a column family #12

Closed hindog closed 11 years ago

hindog commented 11 years ago

The fix allows for a family and column to be included in the query projection, without causing the column selection to narrow the projection. Subtle bugs may arise under the following circumstances:

ExampleSchema.ExampleTable.put("Chris").value(_.misc1, "value1").value(_.title, "some title").value(_.url, "http://example.com").execute()

val result = ExampleSchema.ExampleTable.query2.withKey("Chris").withFamilies(_.meta).withColumns(_.title, _.misc1).single()

Here, the "title" column is defined as part of the "meta" family. We've added both the "meta" family and "title" column. Before this fix, the explicit adding of the "title" column causes the entire "meta" family to no longer be selected. With this fix, a projection consisting of both families and columns will always select the "widest" projection