Hi, Yeah, we definitely need to fix the semantics of the API before the first release, so that the expected results from operations are clear. I think we can open issues to track down these kind of things.
I think deleteByQuery() should have the semantics of HBaseStore's implementation, that is if the query has fields set, then only those fields should be deleted. A test in DataStoreTestUtil also reflects that kind of operation. HBase and other column-stores have a column oriented data modeling, so we should be able to utilize this to the full extend. However, deleting columns in some data stores does not make sense, as in the case of SQL and possibly Solr. So for these, we need to either disable deleteByQuery for queries with fields, ignore the operation or delete the whole row, or set deleted columns to NULL. I think throwing an exception in SQL and Solr stores when fields are set would be fine. In either case, I completely agree that the semantics should be reflected in the javadoc. Also, we may develop a MetaData object which we can use to query the datastore's properties (such as isDeleteByQueryFieldsSetable() or such.) Enis On Sat, Oct 23, 2010 at 1:34 AM, Andrzej Bialecki <[email protected]> wrote: > Hi, > > I'm working on GORA-9, and I'm confused about the semantics of > DataStore.deleteByQuery. My question is motivated by > DataStoreTestUtil.testDeleteByQuery(), which is failing for me. > > So, that's what I could figure out about deleteByQuery so far: > > * In CassandraStore it's apparently not implemented. Bummer. > > * In SqlStore it seems to consider only the range (or a specific value) > of primaryKey-s, regardless of fields that the query specifies. I.e. it > deletes whole rows. > > * In HBaseStore it seems to consider both the primary key (value or > range) AND the fields, and deletes only from columns that match > specified fields, thus leaving partial rows. I understand that this is > motivated by the need to set some Persistent properties to null. But > isn't this in conflict with the semantics of SqlStore.deleteByQuery, > when query contains not all fields? > > Additionally, delete* operations seem to imply a subsequent flush() to > persist the changes, because subsequent execute() or get() is expected > to yield no deleted rows. > > Anyway, we need more docs :) even a javadoc clarification of the above > would help a lot. > > -- > Best regards, > Andrzej Bialecki <>< > ___. ___ ___ ___ _ _ __________________________________ > [__ || __|__/|__||\/| Information Retrieval, Semantic Web > ___|||__|| \| || | Embedded Unix, System Integration > http://www.sigram.com Contact: info at sigram dot com > >
